/* Auth Page Styles - PWA KINGS Dark Theme */

/* Page Layout */
.auth-page {
    display: grid;
    grid-template-columns: minmax(360px, 0.75fr) 1.25fr;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f1419 0%, #1a2a3a 100%);
}

/* Left Side - Form Container */
.auth-left {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(215deg, #0f1419 0%, #365779 100%);
    overflow-y: auto;
}

/*
  Register page spacing tweaks
  Goal: keep the registration form fully visible on common laptop/desktop heights
  without introducing an inner scrollbar.
*/
.auth-page.auth-register {
    height: 100vh;
    overflow: hidden;
    /* Narrower left panel than default 50/50 */
    grid-template-columns: minmax(360px, 0.75fr) 1.25fr;
}

.auth-page.auth-register .auth-left {
    padding: 18px 20px;
    overflow: hidden;
}

.auth-page.auth-register .auth-header.mb-5 {
    margin-bottom: 14px !important;
}

.auth-page.auth-register .auth-logo {
    height: 44px;
    margin-bottom: 12px;
}

.auth-page.auth-register .auth-title {
    font-size: 24px;
    margin-bottom: 6px;
}

.auth-page.auth-register .auth-subtitle {
    font-size: 13px;
}

.auth-page.auth-register .auth-form .form-group.mb-4 {
    margin-bottom: 10px !important;
}

.auth-page.auth-register .form-label {
    margin-bottom: 5px;
    font-size: 12px;
}

.auth-page.auth-register .form-input {
    height: 38px;
}

.auth-page.auth-register .btn-register {
    height: 38px;
    font-size: 14px;
}

.auth-page.auth-register .form-text.text-muted.mt-2 {
    margin-top: 4px !important;
    font-size: 11px;
    line-height: 1.3;
}

.auth-page.auth-register .btn-register.mb-3 {
    margin-bottom: 10px !important;
}

.auth-page.auth-register .auth-terms.mt-4 {
    margin-top: 8px !important;
    font-size: 11px;
    line-height: 1.45;
}

.auth-page.auth-register .auth-footer.mt-4 {
    margin-top: 10px !important;
}

.auth-page.auth-register .footer-text {
    margin: 0 0 4px 0;
}

/*
  Registration form width
  Make the register form a bit narrower than login, to better balance with the
  right-side illustration on wide screens.
*/

.auth-page.auth-register .auth-container {
    max-width: 360px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

/* Header Section */
.auth-header {
    text-align: center;
}

.auth-logo {
    display: inline-block;
    margin-bottom: 30px;
    height: 55px;
}

.auth-logo img {
    height: 100%;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.3));
    transition: filter 0.3s ease;
}

.auth-logo:hover img {
    filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.6));
}

.auth-title {
    font-size: 30px;
    font-weight: 700;
    background: linear-gradient(135deg, #00ffff, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    font-family: 'Raleway', sans-serif;
}

.auth-subtitle {
    font-size: 14px;
    color: #ffffff;
    margin: 0;
}

.auth-link {
    color: #00ffff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: #00e5ff;
    text-decoration: none;
}

/* Form Styles */
.auth-form {
    width: 100%;
}

.form-group {
    position: relative;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

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

.input-icon {
    position: absolute;
    left: 12px;
    color: #00d4ff;
    font-size: 16px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.form-input {
    padding-left: 36px;
    padding-right: 12px;
    height: 44px;
    border: 1px solid #2a4a6a;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    background-color: #fbfbfb;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-input:hover {
    background-color: #e0e7ec;
    border-color: #85a3c0;
}

.form-input:focus {
    border-color: #00d4ff;
    background-color: #eff3f6;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
    outline: none;
}

.form-input:focus + .input-icon {
    color: #00ffff;
}

.form-input::placeholder {
    color: #000000;
    opacity: 1;
}

.form-input.is-invalid {
    border-color: #ff4757;
}

.form-input.is-invalid:focus {
    border-color: #ff4757;
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.15);
}

.invalid-feedback {
    font-size: 12px;
    color: #ff6b7a;
    margin-top: 4px;
    display: block !important;
}

/* Validation popup (comic-style bubble with pointer to field) */
.input-with-icon,
.name-field-col {
    position: relative;
}

.invalid-feedback-popup {
    margin-top: 0;
    padding: 8px 10px;
    background: #ff6b7a;
    color: #ffffff;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.invalid-feedback-popup strong {
    color: inherit;
    font-weight: 600;
}

.input-with-icon .invalid-feedback-popup,
.name-field-col > .invalid-feedback-popup {
    position: absolute;
    top: 50%;
    left: calc(100% + 12px);
    transform: translateY(-50%);
    min-width: 180px;
    max-width: 250px;
}

.input-with-icon .invalid-feedback-popup::before,
.name-field-col > .invalid-feedback-popup::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -7px;
    transform: translateY(-50%);
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 7px solid #ff6b7a;
}

/*
  Register page (desktop): the left column is intentionally narrow.
  Side-positioned validation bubbles overlap neighboring inputs (e.g. first/last name)
  and can appear clipped. On register pages we keep the “bubble” styling, but let the
  message participate in normal layout flow under the field.
*/
.auth-page.auth-register .input-with-icon {
    flex-wrap: wrap;
    align-items: flex-start;
}

.auth-page.auth-register .input-with-icon .invalid-feedback-popup,
.auth-page.auth-register .name-field-col > .invalid-feedback-popup {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin-top: 6px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.auth-page.auth-register .input-with-icon .invalid-feedback-popup::before,
.auth-page.auth-register .name-field-col > .invalid-feedback-popup::before {
    top: -7px;
    left: 22px;
    transform: none;
    border-top: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #ff6b7a;
}

/* Tablet/mobile: keep validation popup below the field to avoid horizontal overflow */
@media (max-width: 992px) {
    .input-with-icon {
        align-items: flex-start;
    }

    .invalid-feedback-popup {
        font-size: 11.5px;
        padding: 7px 9px;
    }

    .input-with-icon .invalid-feedback-popup,
    .name-field-col > .invalid-feedback-popup {
        top: calc(100% + 6px);
        left: 0;
        right: auto;
        transform: none;
        min-width: 0;
        max-width: min(100%, 320px);
        margin-top: 0;
    }

    .input-with-icon .invalid-feedback-popup::before,
    .name-field-col > .invalid-feedback-popup::before {
        top: -7px;
        left: 22px;
        transform: none;
        border-top: 0;
        border-left: 7px solid transparent;
        border-right: 7px solid transparent;
        border-bottom: 7px solid #ff6b7a;
    }
}

/* Forgot Password Link */
.forgot-password-link {
    font-size: 12px;
    color: #00d4ff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.forgot-password-link:hover {
    color: #00ffff;
}

/* Remember Me Checkbox */
.form-check {
    padding-left: 0;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 1px solid #2a4a6a;
    border-radius: 3px;
    background-color: #1a3a50;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.form-check-input:checked {
    background-color: #00d4ff;
    border-color: #00d4ff;
}

.form-check-input:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.form-check-label {
    font-size: 13px;
    color: #ffffff;
    margin-left: 8px;
    cursor: pointer;
    user-select: none;
}

/* Verification Badge */
.verification-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background-color: rgba(0, 212, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.verification-text {
    font-size: 12px;
    color: #00d4ff;
    font-weight: 500;
}

/* Buttons */
.btn-login,
.btn-register {
    height: 44px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, #00d4ff, #00ffff);
    border: none;
    border-radius: 6px;
    color: #0f1419;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    font-family: 'Raleway', sans-serif;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-login:hover,
.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
    color: #0f1419;
}

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

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #6a8a9a;
    font-size: 12px;
    font-weight: 600;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #2a4a6a;
}

.divider::before {
    margin-right: 10px;
}

.divider::after {
    margin-left: 10px;
}

/* Social Login Buttons */
.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 44px;
    padding: 0 16px;
    background-color: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 6px;
    color: #a0aec0;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    font-family: 'Raleway', sans-serif;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-social:hover {
    background-color: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    color: #a0aec0;
    text-decoration: none;
}

.social-icon {
    width: 18px;
    height: 18px;
}

.social-text {
    flex: 1;
    text-align: center;
}

/* Terms & Privacy */
.auth-terms {
    font-size: 12px;
    color: #ffffff;
    text-align: center;
    margin: 0;
    line-height: 1.6;
}

.auth-terms .auth-link {
    color: #00d4ff;
}

/* Footer */
.auth-footer {
    text-align: center;
    color: #ffffff;
    font-size: 11px;
}

.footer-text {
    margin: 0 0 10px 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.footer-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 11px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #00d4ff;
}

.footer-divider {
    color: #2a4a6a;
}

/* Right Side - Branding */
.auth-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
}

.auth-right-content {
    text-align: center;
    max-width: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-right-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.4;
    font-family: 'Raleway', sans-serif;
    background: linear-gradient(135deg, #00ffff, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-right-description {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
}

.auth-right-illustration {
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-right-illustration img {
    width: 100%;
    height: auto;
    max-width: 500px;
    object-fit: contain;
}

/* Responsive Design */
@media (max-width: 992px) {
    .auth-page {
        grid-template-columns: 1fr 0.8fr;
    }

    .auth-page.auth-register {
        grid-template-columns: 1fr 0.95fr;
    }

    .auth-container {
        max-width: 380px;
    }

    .auth-left {
        padding: 30px 15px;
    }

    .auth-right-illustration img {
        max-width: 400px;
    }
}

@media (max-width: 768px) {
    .auth-page {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    /* Register page: override desktop-specific grid and fixed-height settings */
    .auth-page.auth-register {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .auth-right {
        display: none;
    }

    .auth-left {
        padding: 35px 20px;
        min-height: 100vh;
        justify-content: flex-start;
        padding-top: 50px;
    }

    .auth-page.auth-register .auth-left {
        overflow: visible;
    }

    .auth-container {
        width: 100%;
        max-width: 420px;
    }

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

    .auth-logo {
        height: 45px;
    }

    .auth-title {
        font-size: 26px;
        margin-bottom: 10px;
    }

    .auth-subtitle {
        font-size: 14px;
    }

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

    .form-label {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .form-input,
    .btn-login,
    .btn-register,
    .btn-social {
        font-size: 14px;
        height: 42px;
    }

    /* Stack first/last name fields vertically on tablet */
    .name-fields-row {
        display: block !important;
        flex-direction: column;
        gap: 0 !important;
    }

    .name-fields-row > .name-field-col {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 12px;
    }

    .name-fields-row .name-field-col {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .auth-footer {
        margin-top: 25px;
    }

    .footer-text {
        font-size: 10px;
    }

    .footer-link {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .auth-left {
        padding: 30px 16px;
        padding-top: 40px;
    }

    .auth-container {
        width: 100%;
        max-width: 100%;
    }

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

    .auth-logo {
        height: 40px;
        margin-bottom: 20px;
    }

    .auth-title {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .auth-subtitle {
        font-size: 12px;
    }

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

    .form-label {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .form-input,
    .btn-login,
    .btn-register,
    .btn-social {
        font-size: 13px;
        height: 40px;
        border-radius: 4px;
    }

    .input-icon {
        font-size: 14px;
    }

    .forgot-password-link {
        font-size: 11px;
    }

    .form-check-label {
        font-size: 12px;
    }

    .verification-badge {
        padding: 10px;
        gap: 6px;
    }

    .verification-badge img {
        height: 20px;
    }

    .verification-text {
        font-size: 10px;
    }

    /* Stack first/last name fields vertically */
    .name-fields-row {
        display: block !important;
        flex-direction: column;
        gap: 0 !important;
    }

    .name-fields-row > .name-field-col {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 10px;
    }

    .name-fields-row .name-field-col {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .divider {
        font-size: 11px;
        margin: 15px 0;
    }

    .auth-footer {
        margin-top: 20px;
    }

    .footer-text {
        margin: 0 0 8px 0;
        font-size: 9px;
    }

    .footer-links {
        gap: 5px;
    }

    .footer-link {
        font-size: 9px;
    }

    .footer-divider {
        font-size: 8px;
    }

    .auth-terms {
        font-size: 11px;
        margin-top: 15px;
        line-height: 1.5;
    }
}

/* Loading State */
.btn-login.loading,
.btn-register.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-login.loading::after,
.btn-register.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Extra Small Devices */
@media (max-width: 320px) {
    .auth-left {
        padding: 20px 12px;
    }

    .auth-logo {
        height: 35px;
    }

    .auth-title {
        font-size: 18px;
    }

    .auth-form {
        width: 100%;
    }

    .form-input,
    .btn-login,
    .btn-register {
        height: 38px;
        font-size: 12px;
    }

    .form-label {
        font-size: 10px;
    }

    .auth-footer {
        font-size: 8px;
    }
}

/* Error State */
.auth-error {
    padding: 12px;
    background-color: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 6px;
    color: #ff6b7a;
    font-size: 13px;
    margin-bottom: 20px;
}

/* Success State */
.auth-success {
    padding: 12px;
    background-color: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 6px;
    color: #00d4ff;
    font-size: 13px;
    margin-bottom: 20px;
}
