/**
 * CELPIP Pro Authentication Pages - Modern UI Styles
 */

/* Color Variables */
:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --error-color: #f56565;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --background: #f7fafc;
    --card-background: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset and Base */
* {
    box-sizing: border-box;
}

.celpip-auth-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.celpip-auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1200px;
    width: 100%;
    background: var(--card-background);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

.celpip-auth-wrapper.register-wrapper {
    max-width: 1400px;
}

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

/* Auth Card */
.celpip-auth-card {
    padding: 60px;
}

.celpip-auth-card.register-card {
    padding: 40px 60px;
}

/* Logo */
.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-direction: column;
    text-align: center;
}

.logo-image {
    max-width: 180px;
    max-height: 80px;
    object-fit: contain;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.logo-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.auth-logo h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Header */
.auth-header {
    margin-bottom: 40px;
}

.auth-header h2 {
    margin: 0 0 10px;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* Form Styles */
.auth-form {
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

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

.form-group label svg {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-background);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

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

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

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

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

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

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

/* Messages */
.form-messages {
    margin-bottom: 20px;
    min-height: 0;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    animation: slideIn 0.3s ease;
}

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

.message.error {
    background: #fff5f5;
    color: var(--error-color);
    border: 1px solid #feb2b2;
}

.message.success {
    background: #f0fff4;
    color: var(--success-color);
    border: 1px solid #9ae6b4;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    position: relative;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

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

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-block {
    width: 100%;
}

.btn-loader {
    display: inline-flex;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: rotate 1s linear infinite;
}

.spinner circle {
    stroke: white;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

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

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

.auth-footer a:hover {
    color: var(--primary-dark);
}

/* Decoration Panel */
.auth-decoration {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-decoration::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.05)"/></svg>');
    opacity: 0.3;
}

.decoration-content {
    position: relative;
    z-index: 1;
}

.decoration-content h3 {
    margin: 0 0 16px;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
}

.decoration-content p {
    margin: 0 0 32px;
    font-size: 18px;
    opacity: 0.9;
    line-height: 1.6;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 16px;
}

.feature-list li svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 32px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .celpip-auth-wrapper {
        grid-template-columns: 1fr;
    }
    
    .auth-decoration {
        order: -1;
        padding: 40px;
    }
    
    .decoration-content h3 {
        font-size: 28px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .celpip-auth-container {
        padding: 10px;
    }
    
    .celpip-auth-card {
        padding: 40px 30px;
    }
    
    .celpip-auth-card.register-card {
        padding: 30px;
    }
    
    .auth-decoration {
        padding: 30px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .auth-header h2 {
        font-size: 26px;
    }
    
    .decoration-content h3 {
        font-size: 24px;
    }
}

/* Resend Verification Section */
.resend-verification-section {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 5px;
    animation: slideIn 0.3s ease;
}

.resend-verification-section p {
    margin: 0 0 10px;
    color: #856404;
}

.resend-verification-section p:first-child {
    font-size: 14px;
}

.resend-verification-section p:nth-child(2) {
    font-size: 13px;
}

.resend-verification-section strong {
    font-weight: 600;
}

.resend-verification-section .btn-secondary {
    width: 100%;
    padding: 10px;
    background: #ffc107;
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.resend-verification-section .btn-secondary:hover {
    background: #e0a800;
}

.resend-verification-section .btn-secondary:disabled {
    background: #f0e5b8;
    cursor: not-allowed;
}

.resend-verification-message {
    margin-top: 10px;
}

.resend-verification-message p {
    font-size: 13px;
    margin: 0;
    padding: 8px 12px;
    border-radius: 4px;
}

.resend-verification-message .message-success {
    color: #10b981;
    background: #f0fdf4;
    border: 1px solid #86efac;
}

.resend-verification-message .message-error {
    color: #d63638;
    background: #fef2f2;
    border: 1px solid #fca5a5;
}
