/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Login Container */
.login-container {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 400px;
    width: 100%;
    position: relative;
}

/* Login Card */
.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    position: relative;
    z-index: 10;
}

/* Login Header */
.login-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    padding: 24px 32px 20px;
    text-align: center;
    color: white;
}

.logo-image {
    height: 48px;
    width: auto;
    margin-bottom: 4px;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.logo p {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
}

/* Login Content */
.login-content {
    padding: 28px 32px 32px;
}

.login-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
    text-align: center;
}

.login-subtitle {
    color: #64748b;
    text-align: center;
    margin-bottom: 24px;
    font-size: 14px;
}

/* Social Login */
.social-login {
    margin-bottom: 12px;
}

.google-btn {
    width: 100%;
    max-width: 100%;
    min-height: 44px; /* Ensure minimum touch target */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    background: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.05s ease, border-color 0.2s ease;
    box-sizing: border-box; /* Ensure padding doesn't overflow */
    overflow: hidden; /* Prevent content overflow */
}

.google-btn:hover {
    box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.06);
    border-color: #c9cccf;
}

.google-btn:active {
    transform: translateY(0.5px);
}

.google-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(66,133,244,0.25);
}

.google-icon {
    width: 18px !important; /* Force size to prevent SVG natural sizing */
    height: 18px !important;
    min-width: 18px; /* Prevent shrinking */
    min-height: 18px;
    max-width: 18px; /* Prevent growing */
    max-height: 18px;
    flex-shrink: 0; /* Don't shrink in flex container */
    display: block; /* Ensure proper rendering */
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 14px 0 6px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

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

.input-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: #64748b;
    z-index: 1;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.toggle-password:hover {
    background: #f1f5f9;
}

.toggle-password i {
    width: 16px;
    height: 16px;
    color: #64748b;
}

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

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    line-height: 1;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4f46e5;
    margin: 0;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.forgot-password {
    font-size: 14px;
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

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

/* Login Button */
.login-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

.login-btn i {
    width: 18px;
    height: 18px;
}

/* Login Footer */
.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
}

.login-footer p {
    font-size: 14px;
    color: #64748b;
}

.signup-link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

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

/* Background */
.login-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.background-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    background-size: 100px 100px;
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Success Message */
.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
    display: flex;
    align-items: center;
}

.success-message.show {
    display: flex;
}

/* Loading State */
.login-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-btn.loading i {
    animation: spin 1s linear infinite;
}

/* Disabled state: matches loading semantics and blocks interaction */
.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-container {
        max-width: 100%;
        margin: 0;
    }

    .login-header {
        padding: 24px 24px 20px;
    }

    .login-content {
        padding: 24px;
    }

    .logo h1 {
        font-size: 24px;
    }

    .login-content h2 {
        font-size: 20px;
    }
}

/* Success Animation */
@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon {
    animation: checkmark 0.5s ease-in-out;
}

/* Align Turnstile widget with inputs and use light theme container spacing */
.form-group.captcha-group {
  margin-top: 12px;
}
.form-group.captcha-group label {
  display: block;
  margin-bottom: 8px;
  color: #4b5563; /* text-gray-600 */
  font-weight: 500;
}
.captcha-group .turnstile-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.captcha-group .cf-turnstile {
  /* Turnstile full-width alignment (no extra box visuals) */
  width: 100%;
  display: block;
}
.captcha-group .cf-turnstile {
  display: block;
  transform-origin: left top;
}

/* Optional: match vertical rhythm under inputs */
.captcha-group + .login-btn {
  margin-top: 16px;
}