/* Authentication page styles */
/* Base styles for all auth pages */

:root {
    --primary: #7209b7;
    --primary-light: #9d4edd;
    --secondary: #5a189a;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f8961e;
    --info: #4361ee;
    --light: #f8f9fa;
    --dark: #212529;
    --bg-light: #faf8ff;
    --text-dark: #1d3557;
    --text-light: #457b9d;
    --border: #e9d5ff;
    --gradient-1: linear-gradient(135deg, #7209b7, #5a189a);
    --gradient-2: linear-gradient(135deg, #9d4edd, #7209b7);
    --shadow-sm: 0 2px 8px rgba(114, 9, 183, 0.1);
    --shadow-md: 0 4px 12px rgba(114, 9, 183, 0.15);
    --shadow-lg: 0 8px 24px rgba(114, 9, 183, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--gradient-1);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    position: relative;
}

/* Wider container for registration and multi-column forms */
.auth-container.has-form-row {
    max-width: 650px;
}

.auth-header {
    background: var(--gradient-2);
    padding: 30px 25px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.auth-logo {
    font-size: 2.75rem;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    display: inline-block;
    animation: fadeInDown 0.5s ease-out;
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
    letter-spacing: -0.02em;
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

.auth-content {
    padding: 35px 30px;
}

/* Wider content padding for registration forms */
.auth-container.has-form-row .auth-content {
    padding: 40px 35px;
}

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

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
    background-color: #ffffff;
    color: var(--text-dark);
    min-width: 0; /* Prevent overflow */
    box-sizing: border-box;
}

.form-group input::placeholder {
    color: #9ca3af;
    opacity: 0.7;
}

.form-group input:hover {
    border-color: var(--primary-light);
}

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


.form-group input.error {
    border-color: var(--danger);
}

.form-group input.success {
    border-color: var(--success);
}

.form-group .help-text {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 8px;
    line-height: 1.4;
    display: block;
}

.form-group .error-text {
    font-size: 0.85rem;
    color: var(--danger);
    margin-top: 8px;
    display: block;
    font-weight: 500;
    line-height: 1.4;
}

.form-group .error-text:empty {
    display: none;
}

.btn {
    width: 100%;
    max-width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    box-sizing: border-box;
    grid-column: 1 / -1; /* Span all columns if inside a grid */
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Ensure button spans full width, not constrained by form-row */
form {
    width: 100%;
    display: block;
}

form > .btn {
    width: 100% !important;
    max-width: 100% !important;
    grid-column: 1 / -1;
    margin-top: 0.5rem;
    clear: both;
    box-sizing: border-box;
}

/* Ensure button breaks out of any grid layout */
.auth-content form > .btn {
    margin-left: 0;
    margin-right: 0;
}

/* Registration form button - half width and centered */
.auth-container.has-form-row form > .btn {
    width: 50% !important;
    max-width: 50% !important;
    margin-left: auto;
    margin-right: auto;
    display: flex;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.btn .loading {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

.btn.loading .loading {
    display: inline-block;
}

.btn.loading .btn-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.auth-links {
    margin-top: 25px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: block;
}

.message.error {
    background: #fee;
    color: var(--danger);
    border: 1px solid #fcc;
}

.message.success {
    background: #efe;
    color: var(--success);
    border: 1px solid #cfc;
}

.message.info {
    background: #eef;
    color: var(--info);
    border: 1px solid #ccf;
}

.password-strength {
    margin-top: 5px;
    font-size: 0.8rem;
}

.password-strength .strength-text {
    font-size: 0.8rem;
    color: var(--text-light);
}

.password-strength .strength-bar {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.password-strength .strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength.weak .strength-fill {
    background: var(--danger);
    width: 25%;
}

.password-strength.fair .strength-fill {
    background: var(--warning);
    width: 50%;
}

.password-strength.good .strength-fill {
    background: var(--info);
    width: 75%;
}

.password-strength.strong .strength-fill {
    background: var(--success);
    width: 100%;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 2px 0 0 0;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.checkbox-group label {
    margin: 0;
    font-size: 0.9rem;
    cursor: pointer;
    line-height: 1.5;
    color: var(--text-dark);
    flex: 1;
}

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

.checkbox-group label a:hover {
    text-decoration: underline;
}

/* Form layout utilities */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

/* Ensure form rows have enough space */
.auth-container.has-form-row .form-row {
    gap: 1.75rem;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    color: var(--text-light);
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.75rem;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Info icon tooltip */
.info-icon {
    display: inline-block;
    margin-left: 6px;
    position: relative;
    cursor: help;
    color: var(--info);
    font-size: 0.85rem;
    vertical-align: middle;
}

.info-icon:hover {
    color: var(--primary);
}

.info-icon[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 8px 12px;
    background: var(--text-dark);
    color: white;
    font-size: 0.75rem;
    max-width: 250px;
    white-space: normal;
    text-align: center;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
    line-height: 1.4;
}

.info-icon[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    margin-bottom: 2px;
    border: 5px solid transparent;
    border-top-color: var(--text-dark);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
}

@keyframes tooltipFadeIn {
    to { opacity: 1; }
}

/* Resend verification box */
.resend-verification-box {
    background: #eff6ff;
    border: 1px solid var(--info);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin: 20px 0;
    text-align: center;
}

.resend-verification-box p {
    margin: 0 0 10px 0;
    color: var(--text-dark);
    font-size: 0.85rem;
}

.resend-link {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.resend-link:hover {
    background: var(--primary);
    color: white;
    text-decoration: none;
}

.resend-link i {
    margin-right: 6px;
}

/* Info section */
.info-section {
    margin: 25px 0;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--info);
}

.info-section p {
    margin-bottom: 10px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

.info-section ul {
    margin: 10px 0 0 20px;
    padding-left: 10px;
}

.info-section li {
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Auth footer */
.auth-footer {
    padding: 15px 25px;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg-light);
}

.auth-footer .auth-links {
    margin-top: 0;
    margin-bottom: 10px;
}

.auth-copyright {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 10px;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container.has-form-row {
        max-width: 100%;
    }
    
    .auth-container.has-form-row .form-row {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .auth-container {
        margin: 10px;
        border-radius: var(--radius-md);
        max-width: calc(100% - 20px);
    }
    
    .auth-container.has-form-row {
        max-width: calc(100% - 20px);
    }
    
    .auth-header {
        padding: 24px 20px;
    }
    
    .auth-content {
        padding: 28px 20px;
    }
    
    .auth-container.has-form-row .auth-content {
        padding: 30px 20px;
    }
    
    .auth-logo {
        font-size: 2.25rem;
    }
    
    .auth-title {
        font-size: 1.4rem;
    }
    
    .form-group input {
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}
