/* Authentication Pages Styles */

.auth-body {
    background: var(--bg-color);
    color: var(--text-primary);
    padding: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0;
    /* Remove blue tap highlight on mobile */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-color);
    position: relative;
}

/* Login page specific - block scrolling completely */
.auth-container.login-page {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

body:has(.login-page) {
    overflow: hidden !important;
    height: 100vh !important;
    max-height: 100vh !important;
    position: fixed;
    width: 100%;
}

html:has(.login-page) {
    overflow: hidden !important;
    height: 100vh !important;
    max-height: 100vh !important;
}

/* Logo watermark in background */
.auth-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background-image: url('../images/handlogo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.03;
    pointer-events: none;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 16px;
    box-shadow: none;
    width: 100%;
    max-width: 550px;
    padding: 40px 50px;
    margin-top: 5px;
    animation: slideUp 0.4s ease;
    position: relative;
    z-index: 1;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-logo img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: var(--icon-filter);
}

.auth-header {
    text-align: center;
    margin-bottom: 25px;
}

.auth-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 14px;
}

.alert-error {
    background: rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

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

.oauth-buttons {
    margin-bottom: 14px;
}

/* Anchor version of auth button (Google, etc.) */
.oauth-buttons .auth-btn {
    text-decoration: none;
}

.oauth-btn {
    border-color: rgba(128, 128, 128, 0.35);
    color: var(--text-primary);
}

.oauth-btn:hover {
    border-color: var(--primary-hover);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    height: 1px;
    flex: 1;
    background: rgba(128, 128, 128, 0.2);
}

.auth-divider span {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 18px;
    color: var(--text-secondary);
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
}

.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    opacity: 0.6;
    transition: opacity 0.3s ease;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.toggle-password:hover {
    opacity: 1;
}

.toggle-password i {
    font-size: 18px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px 12px 45px;
    border: 1px solid rgba(128, 128, 128, 0.25);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: var(--bg-color);
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
    font-size: 14px;
}

/* Prevent autofill/paste from changing background color */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group input:-webkit-autofill:active {
    -webkit-background-clip: text;
    -webkit-text-fill-color: var(--text-primary);
    transition: background-color 5000s ease-in-out 0s;
    box-shadow: inset 0 0 0 1000px var(--bg-color);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 13px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Make checkbox tick red when checked (login + register) */
.checkbox-label input[type="checkbox"]:checked {
    accent-color: #e53935;
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.forgot-link:hover {
    color: var(--primary-hover);
}

.auth-btn {
    width: 100%;
    padding: 14px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.auth-btn i {
    font-size: 18px;
}

.auth-btn:hover {
    background: transparent;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-hover);
}

.auth-btn:active {
    transform: translateY(0);
    background: transparent;
}

.auth-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(128, 128, 128, 0.2);
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 13px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .auth-container.login-page {
        align-items: flex-start;
        padding-top: 80px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .auth-container {
        padding: 10px;
        padding-top: 10px;
    }
    
    .auth-container.login-page {
        align-items: flex-start;
        padding-top: 50px;
    }
    
    .auth-container::before {
        width: 200px;
        height: 200px;
    }

    .auth-card {
        padding: 25px 20px;
        box-shadow: none;
    }

    .auth-header {
        margin-bottom: 15px;
    }

    .auth-header h1 {
        font-size: 22px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-options {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        margin-bottom: 15px;
        flex-wrap: nowrap;
    }
    
    .checkbox-label {
        font-size: 13px;
    }
    
    .forgot-link {
        font-size: 13px;
    }
}

/* Dark mode specific adjustments */
@media (prefers-color-scheme: dark) {
    .auth-container::before {
        opacity: 0.05;
    }
    
    .alert-error {
        background: rgba(0, 0, 0, 0.15);
    }
}

