/* AMA Surf Camp Custom Authentication Styles v1.08 */

/* Hide default WP logo */
body.campflow-auth-page h1.wp-login-logo {
    display: none !important;
}

/* Background & Main Layout */
body.campflow-auth-page {
    /* Beautiful tropical sunset background */
    background-image: url("/wp-content/uploads/2026/08/ChatGPT-Image-Aug-29-2026-01_04_56-PM.png") !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    background-color: #fef4e8 !important; /* Fallback */
    
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    color: #172033 !important;
    overflow-x: hidden;
}

/* Main Login Container - Premium Card */
body.campflow-auth-page #login {
    width: 100%;
    max-width: 440px;
    padding: 0; box-sizing: border-box;
    margin: 0;
    position: relative;
    z-index: 10;
}

body.campflow-auth-page #loginform,
body.campflow-auth-page #lostpasswordform,
body.campflow-auth-page #resetpassform {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(11, 130, 136, 0.08), 0 4px 15px rgba(0,0,0,0.03);
    padding: 40px 32px;
    margin-top: 0;
}

/* Ensure no default h1 shows inside loginform */
body.campflow-auth-page h1 {
    display: none;
}

/* Logo styling */
body.campflow-auth-page .cf-auth-logo {
    display: block;
    margin: 0 auto 24px auto;
    max-width: 150px;
    height: auto;
}

/* Auth Header inside the card */
body.campflow-auth-page .cf-auth-header {
    text-align: center;
    margin-bottom: 28px;
}
body.campflow-auth-page .cf-auth-icon-wrap {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}
body.campflow-auth-page .cf-auth-icon {
    width: 72px;
    height: 72px;
    background-color: #ebf8f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: #0b8288;
    box-sizing: border-box;
}

body.campflow-auth-page .cf-auth-title {
    font-size: 24px;
    font-weight: 700;
    color: #172033;
    margin: 0 0 8px 0;
}
body.campflow-auth-page .cf-auth-subtitle {
    font-size: 15px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}
body.campflow-auth-page .cf-auth-subtitle a {
    color: #0b8288;
    text-decoration: none;
    font-weight: 600;
}
body.campflow-auth-page .cf-auth-subtitle a:hover {
    text-decoration: underline;
}

/* Labels */
body.campflow-auth-page label {
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

/* Inputs */
body.campflow-auth-page input[type="text"],
body.campflow-auth-page input[type="password"],
body.campflow-auth-page input[type="email"] {
    width: 100%;
    height: 52px;
    padding: 14px 16px 14px 44px; /* Space for icon */
    font-size: 15px;
    line-height: 1.5;
    color: #172033;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    margin-bottom: 24px;
}

/* Input Icons via background */
body.campflow-auth-page input[type="text"],
body.campflow-auth-page input[type="email"],
body.campflow-auth-page input[name="user_login"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
}

body.campflow-auth-page input[type="password"],
body.campflow-auth-page input[name="pwd"],
body.campflow-auth-page input[name="pass1"],
body.campflow-auth-page input[name="pass2"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
}

body.campflow-auth-page input[type="text"]:focus,
body.campflow-auth-page input[type="password"]:focus,
body.campflow-auth-page input[type="email"]:focus {
    border-color: #0b8288;
    box-shadow: 0 0 0 4px rgba(11, 130, 136, 0.15);
    outline: none;
}

/* Submit Button */
body.campflow-auth-page .submit {
    margin: 0;
    padding: 0; box-sizing: border-box;
}

body.campflow-auth-page .button-primary {
    width: 100%;
    background-color: #0b8288;
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    height: 52px;
    line-height: 52px; /* Fix vertical alignment */
    text-shadow: none;
    box-shadow: 0 4px 12px rgba(11, 130, 136, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-align: center;
    padding: 0; box-sizing: border-box; /* Remove padding as line-height handles centering */
}

/* Wave Icon in Button */
body.campflow-auth-page .button-primary {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12h4l3-9 5 18 3-9h5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(50% - 40px) center;
    text-indent: 28px;
}

body.campflow-auth-page .button-primary:hover,
body.campflow-auth-page .button-primary:focus {
    background-color: #096a6f;
    box-shadow: 0 8px 20px rgba(11, 130, 136, 0.4);
    transform: translateY(-2px);
    color: #ffffff;
}

body.campflow-auth-page .button-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(11, 130, 136, 0.25);
}

/* Password generator secondary button */
body.campflow-auth-page .button-secondary.wp-generate-pw {
    width: 100%;
    background-color: transparent;
    border: 1.5px solid #0b8288;
    color: #0b8288;
    font-weight: 600;
    border-radius: 12px;
    padding: 14px 24px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
}
body.campflow-auth-page .button-secondary.wp-generate-pw:hover {
    background-color: #ebf8f9;
}

/* Remember Me / Forgot Password Layout */
body.campflow-auth-page .forgetmenot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    float: none;
    width: 100%;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 12px;
}
/* Flexbox trick for the checkbox */
body.campflow-auth-page .forgetmenot label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
}
body.campflow-auth-page .forgetmenot input[type="checkbox"] {
    margin-top: 0;
    margin-right: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}
body.campflow-auth-page .forgetmenot input[type="checkbox"]:checked {
    background-color: #0b8288;
    border-color: #0b8288;
}

/* Forgot Password Link (moved via JS) */
body.campflow-auth-page .cf-forgot-password-link {
    color: #f59e0b; /* AMA Orange */
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}
body.campflow-auth-page .cf-forgot-password-link:hover {
    color: #d97706;
}

/* Register Link inside #nav */
body.campflow-auth-page #nav {
    text-align: center;
    margin: 24px 0 0 0;
    padding: 0; box-sizing: border-box;
    font-size: 14px;
    color: #475569;
}
body.campflow-auth-page #nav .cf-register-link {
    color: #0b8288;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}
body.campflow-auth-page #nav .cf-register-link:hover {
    color: #096a6f;
    text-decoration: underline;
}

/* Back to AMA Surf Camp link (outside card) */
body.campflow-auth-page #backtoblog {
    text-align: center;
    margin-top: 32px;
    padding: 0; box-sizing: border-box;
}
body.campflow-auth-page #backtoblog a {
    color: #172033;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s ease;
    display: inline-block;
    background: rgba(255,255,255,0.7);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}
body.campflow-auth-page #backtoblog a:hover {
    opacity: 0.8;
}

/* Messages & Errors */
body.campflow-auth-page .message,
body.campflow-auth-page .success,
body.campflow-auth-page #login_error {
    border-radius: 12px;
    border: none;
    padding: 16px;
    margin-bottom: 24px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
body.campflow-auth-page .message,
body.campflow-auth-page .success {
    background-color: #f0fdf4;
    border-left: 4px solid #22c55e;
    color: #166534;
}
body.campflow-auth-page #login_error {
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

/* Hide duplicate WP default messages */
body.campflow-action-checkemail .message,
body.campflow-action-lostpassword .message,
body.campflow-action-resetpass .message,
body.campflow-action-rp .message {
    display: none !important;
}
body.campflow-auth-page #login_error {
    display: block !important;
}

/* Password visibility toggle */
body.campflow-auth-page .wp-pwd {
    position: relative;
}
body.campflow-auth-page .button.wp-hide-pw {
    color: #94a3b8;
    border: none;
    background: transparent;
    box-shadow: none;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px;
    height: auto;
    cursor: pointer;
}
body.campflow-auth-page .button.wp-hide-pw:hover,
body.campflow-auth-page .button.wp-hide-pw:focus {
    color: #0b8288;
    outline: none;
    background: transparent;
}

/* Password Strength Meter */
#pass-strength-result {
    border-radius: 8px;
    border: none;
    background: #f8fafc;
    margin-top: 8px;
    margin-bottom: 16px;
    font-weight: 600;
    padding: 10px;
}
#pass-strength-result.short { color: #ef4444; background: #fef2f2; }
#pass-strength-result.bad { color: #f59e0b; background: #fffbeb; }
#pass-strength-result.good { color: #3b82f6; background: #eff6ff; }
#pass-strength-result.strong { color: #22c55e; background: #f0fdf4; }
.indicator-hint { color: #64748b; font-size: 13px; line-height: 1.5; margin-bottom: 24px; }

/* Responsive Adjustments */
@media (max-width: 480px) {
    body.campflow-auth-page #login {
        padding: 16px;
        max-width: 100%;
        width: 100%;
    }
    body.campflow-auth-page #loginform,
    body.campflow-auth-page #lostpasswordform,
    body.campflow-auth-page #resetpassform {
        padding: 32px 24px;
        border-radius: 20px;
    }
    body.campflow-auth-page .cf-auth-logo {
        max-width: 130px;
    }
    body.campflow-auth-page .cf-auth-title {
        font-size: 22px;
    }
}

/* Flex layout tweaks for #loginform to allow ordering */
body.campflow-auth-page #loginform,
body.campflow-auth-page #lostpasswordform,
body.campflow-auth-page #resetpassform {
    display: flex;
    flex-direction: column;
}
/* Make sure inputs and their wrappers retain correct order */
body.campflow-auth-page #loginform > *:not(.forgetmenot):not(.submit):not(#nav),
body.campflow-auth-page #lostpasswordform > *:not(.submit):not(#nav),
body.campflow-auth-page #resetpassform > *:not(.submit):not(#nav) {
    order: 1;
}
body.campflow-auth-page #loginform > .forgetmenot {
    order: 2;
}
body.campflow-auth-page #loginform > .submit,
body.campflow-auth-page #lostpasswordform > .submit,
body.campflow-auth-page #resetpassform > .submit {
    order: 3;
    margin-top: 8px;
}
/* If there are any hidden inputs, ensure they don't mess up layout */
body.campflow-auth-page #loginform > input[type="hidden"] {
    order: 4;
}

body.campflow-auth-page #loginform > #nav,
body.campflow-auth-page #lostpasswordform > #nav,
body.campflow-auth-page #resetpassform > #nav {
    order: 5;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}
