/* PartnerAll Login Theme - standalone layout */

@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Figtree', ui-sans-serif, system-ui, -apple-system, sans-serif;
    color: #1f2937;
    background-color: #1a202c;
    background-image: url('../img/communities-home.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background-color: rgba(0, 0, 0, 0.25);
}

.login-container {
    width: 100%;
    max-width: 28rem;
    animation: slide_down_fade_in 0.3s ease-out forwards;
}

@keyframes slide_down_fade_in {
    from {
        opacity: 0;
        transform: translateY(-3rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo img {
    max-height: 60px;
    width: auto;
}

.login-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    padding: 32px 28px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 400;
    color: #1f2937;
    text-align: center;
    margin: 0 0 12px;
}

.login-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    margin: 0 0 28px;
    line-height: 1.5;
}
.login-subtitle:empty { display: none; }

.login-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"] {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #1f2937;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.login-form input:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.login-form input[type="submit"],
.login-form button[type="submit"] {
    width: 100%;
    height: 2.75rem;
    margin-top: 8px;
    padding: 0.5rem 1rem;
    background-color: #1f2937;
    color: white;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background-color 0.15s;
    font-family: inherit;
}

.login-form input[type="submit"]:hover,
.login-form button[type="submit"]:hover {
    background-color: #374151;
}

.login-form .pf-c-form__group,
.login-form .form-group {
    margin-bottom: 16px;
}

.login-form .form-group-submit {
    margin-top: 28px;
    margin-bottom: 0;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-warning {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* OTP code input - larger, centered */
input[name="email-otp"],
input[name="emailOTPCode"],
input[name="code"],
input[name="otp"] {
    font-size: 1.5rem !important;
    letter-spacing: 0.5rem !important;
    text-align: center !important;
    font-weight: 600 !important;
    height: 3rem;
}

/* Inform the user that the code is on its way - shown only on the OTP step */
.otp-email-message {
    display: block;
    color: #6b7280;
    font-size: 0.8125rem;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 20px;
    padding: 10px 12px;
    background-color: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* OTP buttons spacing */
#kc-form-buttons {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#kc-otp-login-form #kc-login {
    width: 100%;
    height: 2.75rem;
    background-color: #1f2937;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
}
#kc-otp-login-form #kc-login:hover {
    background-color: #374151;
}

#kc-otp-login-form #kc-resend-email {
    width: 100%;
    background-color: transparent;
    color: #6b7280;
    border: none;
    text-decoration: underline;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 8px;
}
#kc-otp-login-form #kc-resend-email:hover {
    color: #1f2937;
}

#kc-otp-login-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

#kc-otp-login-form input[type="text"] {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    color: #1f2937;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    font-family: inherit;
    margin-top: 4px;
}

/* OTP page spacing: breathing room between code input, submit button, resend link */
#kc-form-buttons,
.login-card form > button[type="submit"],
.login-card form > input[type="submit"] {
    margin-top: 32px;
}

.login-card form .kc-form-buttons,
.login-card form .form-actions {
    margin-top: 32px;
}

/* Resend link / secondary action */
.login-card a,
#kc-form-options a,
.login-card .resend-link,
.kc-otp-resend,
form[action*="resend"] {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #6b7280;
    text-decoration: underline;
    font-size: 0.875rem;
}

.login-card a:hover,
#kc-form-options a:hover {
    color: #1f2937;
}

/* Secondary buttons (like resend, use different email) */
.login-card input[type="submit"].btn-secondary,
.login-card button.btn-link,
.login-card input[type="submit"][name*="resend"],
.login-card button[name*="resend"] {
    background-color: transparent;
    color: #6b7280;
    border: none;
    margin-top: 16px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    text-decoration: underline;
    padding: 8px;
}

.login-card input[type="submit"].btn-secondary:hover,
.login-card button.btn-link:hover,
.login-card input[type="submit"][name*="resend"]:hover,
.login-card button[name*="resend"]:hover {
    background-color: transparent;
    color: #1f2937;
}

/* Field error message */
.input-error,
#input-error-email,
.pf-c-form__helper-text {
    color: #b91c1c;
    font-size: 0.8125rem;
    margin-top: 4px;
    display: block;
}

@media (max-width: 640px) {
    .login-card {
        padding: 24px 20px;
        border-radius: 8px;
    }
    .login-logo img {
        max-height: 48px;
    }
}
