/* Auth Page Specific Styles */

/* Split-panel auth wrapper (branding left + form right) */
.auth-wrapper {
    display: flex;
    min-height: 520px;
    max-width: 900px;
    margin: 30px auto;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}

.auth-branding-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(160deg, #004400 0%, #006600 50%, #009900 100%);
    color: white;
    padding: 40px 30px;
    width: 38%;
    flex-shrink: 0;
    text-align: center;
}

.auth-branding-panel .brand-icon {
    font-size: 3.5em;
    margin-bottom: 20px;
}

.auth-branding-panel h2 {
    color: white;
    font-size: 1.6em;
    margin-bottom: 12px;
    line-height: 1.3;
}

.auth-branding-panel p {
    color: rgba(255,255,255,0.82);
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 20px;
}

.auth-branding-features {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.auth-branding-features li {
    color: rgba(255,255,255,0.9);
    font-size: 0.88em;
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-branding-features li i {
    color: #7dff7d;
    font-size: 1em;
    flex-shrink: 0;
}

.auth-container {
    flex: 1;
    background: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.auth-tabs {
    display: flex;
    background-color: #f5f5f5;
    border-bottom: 2px solid #e8e8e8;
}

.auth-tab {
    flex: 1;
    padding: 16px 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    color: #888;
    transition: all 0.25s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.auth-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.25s;
}

.auth-tab.active {
    background: white;
    color: #006600;
}

.auth-tab.active::after {
    background: #006600;
}

.auth-tab:hover:not(.active) {
    background-color: #eeeeee;
    color: #444;
}

.auth-form-container {
    padding: 32px 30px 28px;
    flex: 1;
    overflow-y: auto;
}

.auth-form-container h2 {
    text-align: center;
    color: #006600;
    margin-bottom: 8px;
    font-size: 26px;
}

.auth-subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 24px;
    font-size: 14px;
}

.auth-form-container .form-group {
    margin-bottom: 18px;
}

.auth-form-container label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 600;
    font-size: 13px;
}

.auth-form-container label i {
    margin-right: 5px;
    color: #006600;
}

.auth-form-container input[type="text"],
.auth-form-container input[type="email"],
.auth-form-container input[type="password"],
.auth-form-container select {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: #fafafa;
}

.auth-form-container input[type="text"]:focus,
.auth-form-container input[type="email"]:focus,
.auth-form-container input[type="password"]:focus,
.auth-form-container select:focus {
    outline: none;
    border-color: #006600;
    box-shadow: 0 0 0 3px rgba(0, 102, 0, 0.12);
    background: white;
}

/* Password field with show/hide toggle */
.password-field-wrapper {
    position: relative;
}

.password-field-wrapper input {
    padding-right: 44px !important;
}

.password-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 1em;
    padding: 4px;
    margin: 0;
    min-width: auto;
    width: auto;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    text-transform: none;
    letter-spacing: normal;
    font-weight: normal;
}

.password-toggle-btn:hover {
    color: #006600;
    transform: translateY(-50%);
    box-shadow: none;
    background: none;
}

/* Password strength bar */
.password-strength {
    margin-top: 6px;
    display: none;
}

.password-strength.visible {
    display: block;
}

.strength-bar {
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
    width: 0%;
}

.strength-fill.weak   { background: #cc0000; }
.strength-fill.fair   { background: #e07b00; }
.strength-fill.good   { background: #ccbb00; }
.strength-fill.strong { background: #006600; }

.strength-label {
    font-size: 11px;
    font-weight: 600;
}

.account-type-select {
    cursor: pointer;
    background: white;
}

.account-type-select option {
    padding: 10px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    color: #666;
    font-weight: normal;
}

.remember-me input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.remember-me span {
    cursor: pointer;
}

/* Page Footer */
.page-footer {
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: #666;
}

.forgot-password {
    color: #006600;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: #009900;
    text-decoration: underline;
}

.auth-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(to right, #006600, #009900);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.auth-button:hover {
    background: linear-gradient(to right, #004400, #007700);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 0, 0.3);
}

.auth-button i {
    margin-right: 8px;
}

.auth-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e0e0e0;
}

.auth-divider span {
    background: white;
    padding: 0 15px;
    color: #999;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.social-button {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.social-button i {
    margin-right: 12px;
    font-size: 20px;
}

.social-button.google {
    background: linear-gradient(to bottom, #ffffff, #f8f8f8);
    border-color: #dadce0;
}

.social-button.google:hover {
    background: linear-gradient(to bottom, #f8f8f8, #f0f0f0);
    border-color: #4285f4;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(66, 133, 244, 0.2);
}

.social-button.google:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.social-button.google i {
    background: linear-gradient(to bottom, #EA4335 0%, #FBBC05 25%, #34A853 50%, #4285F4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.auth-message.success {
    background-color: #e6f7e6;
    color: #006600;
    border: 1px solid #006600;
    display: block;
}

.auth-message.error {
    background-color: #ffe6e6;
    color: #cc0000;
    border: 1px solid #cc0000;
    display: block;
}

.auth-message.info {
    background-color: #e6f2ff;
    color: #0066cc;
    border: 1px solid #0066cc;
    display: block;
    text-align: left;
}

.auth-message h3 {
    margin-top: 0;
    font-size: 16px;
}

.auth-message ol,
.auth-message ul {
    margin: 10px 0;
    padding-left: 25px;
}

.auth-message li {
    margin: 5px 0;
}

/* Sign In/Up combined button (shown when user is not logged in) */
.sign-in-up-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #006600, #009900);
    color: white !important;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 102, 0, 0.25);
}

.sign-in-up-btn:hover {
    background: linear-gradient(135deg, #004400, #007700);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 0, 0.4);
    color: white !important;
}

/* Keep legacy sign-in/sign-up classes for backward compat */
.sign-in-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: linear-gradient(to right, #006600, #009900);
    color: white !important;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.sign-in-btn:hover {
    background: linear-gradient(to right, #004400, #007700);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 0, 0.35);
    color: white !important;
}

.sign-up-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: white;
    color: #006600 !important;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #006600;
    transition: all 0.3s;
    white-space: nowrap;
    margin-left: 8px;
}

.sign-up-btn:hover {
    background: #006600;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 0, 0.35);
}

/* Welcome button (shown when user is logged in) */
.user-welcome-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: linear-gradient(to right, #006600, #009900);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.user-welcome-btn:hover {
    background: linear-gradient(to right, #004400, #007700);
    box-shadow: 0 4px 12px rgba(0, 102, 0, 0.35);
}

.user-welcome-btn .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.25);
}

.user-welcome-text {
    color: white;
    font-size: 14px;
    font-weight: 600;
    max-width: min(180px, 20vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-welcome-chevron {
    color: white;
    font-size: 11px;
}

/* User Profile Dropdown (for logged in state) */
.user-profile {
    position: relative;
    display: inline-block;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(to right, #006600, #009900);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    font-size: 18px;
}

.user-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    display: none;
    z-index: 1000;
}

.user-dropdown.active {
    display: block;
}

.user-dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.3s;
    border-bottom: 1px solid #f0f0f0;
}

.user-dropdown-item:last-child {
    border-bottom: none;
}

.user-dropdown-item:hover {
    background-color: #f8f8f8;
}

.user-dropdown-item i {
    margin-right: 10px;
    color: #006600;
}

/* Loading Spinner */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #006600;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 720px) {
    .auth-wrapper {
        flex-direction: column;
        margin: 15px;
        max-width: 100%;
        min-height: unset;
    }

    .auth-branding-panel {
        width: 100%;
        padding: 28px 20px 22px;
    }

    .auth-branding-panel .brand-icon { font-size: 2.5em; }
    .auth-branding-panel h2 { font-size: 1.3em; }
    .auth-branding-features { display: none; }

    .auth-form-container {
        padding: 24px 20px 20px;
    }
    
    .auth-form-container h2 {
        font-size: 22px;
    }

    /* Prevent iOS auto-zoom on form inputs */
    .auth-form-container input[type="text"],
    .auth-form-container input[type="email"],
    .auth-form-container input[type="password"],
    .auth-form-container select {
        font-size: 16px;
    }
}

/* Inline link button - used for in-message action links (e.g. "sign in" in error messages) */
.inline-link-btn {
    background: none;
    border: none;
    color: #006600;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    text-decoration: underline;
}

/* hCaptcha widget container */
.hcaptcha-container {
    display: flex;
    justify-content: center;
    margin-bottom: 0;
}

/* Small phones (≤ 400px) */
@media (max-width: 400px) {
    .auth-wrapper { margin: 8px; }
    .auth-branding-panel { padding: 20px 14px 16px; }
    .auth-form-container { padding: 18px 14px 16px; }
    .auth-tabs .auth-tab { padding: 13px 10px; font-size: 12px; }
    .auth-button { padding: 12px; font-size: 14px; }
}
