/* ==========================================================================
   🔐 PREMIUM LOGIN PAGE — MEDIUM GLASSMORPHISM
   ========================================================================== */

@import url('fonts.css');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-1: #0f172a;
    --bg-2: #1e293b;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 94, 26, 0.15);
    --accent: #ff5e1a;
    --accent-glow: rgba(255, 94, 26, 0.3);
    --accent-dark: #e64a00;
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(51, 65, 85, 0.8);
    --danger: #ef4444;
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-1);
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

/* ──── ANIMATED BACKGROUND ──── */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(255, 94, 26, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 94, 26, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #020617 100%);
    animation: bgShift 10s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(20deg);
    }
}

/* ──── FLOATING PARTICLES ──── */
.particle {
    position: fixed;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.08;
    animation: float linear infinite;
    z-index: 0;
}

.particle:nth-child(1) {
    width: 6px;
    height: 6px;
    left: 10%;
    animation-duration: 12s;
    top: 80%;
}

.particle:nth-child(2) {
    width: 4px;
    height: 4px;
    left: 25%;
    animation-duration: 18s;
    top: 60%;
}

.particle:nth-child(3) {
    width: 8px;
    height: 8px;
    left: 50%;
    animation-duration: 15s;
    top: 90%;
}

.particle:nth-child(4) {
    width: 5px;
    height: 5px;
    left: 75%;
    animation-duration: 20s;
    top: 70%;
}

.particle:nth-child(5) {
    width: 7px;
    height: 7px;
    left: 90%;
    animation-duration: 14s;
    top: 85%;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.08;
    }

    50% {
        opacity: 0.15;
    }

    100% {
        transform: translateY(-100vh) scale(1.2);
        opacity: 0;
    }
}

/* ──── MAIN CARD ──── */
.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 20px 16px;
    margin: auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.login-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px 36px 36px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: cardEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(24px);
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.login-card::-webkit-scrollbar {
    width: 5px;
}

.login-card::-webkit-scrollbar-thumb {
    background: rgba(255, 94, 26, 0.3);
    border-radius: 10px;
}

@keyframes cardEntrance {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ──── LOGO ICON ──── */
.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo-img {
    max-width: 240px;
    height: auto;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(255, 94, 26, 0.15));
}

/* ──── HEADINGS ──── */
.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 13.5px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}

/* ──── FORM FIELDS ──── */
.form-group-custom {
    margin-bottom: 18px;
}

.form-label-custom {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color 0.3s;
}

.input-icon svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.form-control-custom {
    width: 100%;
    padding: 12px 14px 12px 44px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

.form-control-custom::placeholder {
    color: #4b5563;
}

.form-control-custom:focus {
    border-color: var(--accent);
    background: rgba(255, 94, 26, 0.05);
    box-shadow: 0 0 0 3px rgba(255, 94, 26, 0.15);
}

.form-control-custom:focus+.input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--accent);
}

.form-control-custom.has-toggle {
    padding-right: 44px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: 8px;
    transition: all 0.2s ease;
    z-index: 5;
}

.password-toggle-btn:hover {
    color: var(--accent);
    background: rgba(255, 94, 26, 0.12);
}

.password-toggle-btn.active {
    color: var(--accent);
}

.password-toggle-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    transition: transform 0.15s ease;
}

.password-toggle-btn:active svg {
    transform: scale(0.9);
}

/* ──── ERROR MESSAGE ──── */
.error-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--danger);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shake 0.4s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* ──── LOGIN BUTTON ──── */
.btn-login {
    width: 100%;
    padding: 13px;
    margin-top: 6px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 16px rgba(255, 94, 26, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(255, 94, 26, 0.4);
}

/* ──── FOOTER TEXT ──── */
.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.login-footer span {
    color: var(--accent);
    font-weight: 600;
}

/* ──── CREATE ACCOUNT SECTION ──── */
.signup-divider {
    text-align: center;
    margin: 18px 0 12px;
    position: relative;
}

.signup-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.signup-divider span {
    position: relative;
    z-index: 2;
    background: #192337;
    padding: 0 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.btn-create-account {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 94, 26, 0.1);
    border: 1.5px dashed var(--accent);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-create-account:hover {
    background: rgba(255, 94, 26, 0.2);
    border-style: solid;
    transform: translateY(-1px);
}

/* ──── SIGNUP MODAL ──── */
.signup-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.3s ease-out;
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.signup-modal-card {
    background: #1e293b;
    border: 1px solid rgba(255, 94, 26, 0.3);
    border-radius: 20px;
    width: 100%;
    max-width: 560px;
    padding: 24px 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: min(90vh, calc(100vh - 32px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #f8fafc;
    font-family: 'Inter', sans-serif;
}

@keyframes scaleUp {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.signup-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.signup-modal-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.signup-modal-title svg {
    width: 22px;
    height: 22px;
    color: var(--accent);
}

.signup-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s;
}

.signup-close-btn:hover {
    color: var(--danger);
}

.signup-modal-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.4;
    flex-shrink: 0;
}

#signupForm {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
}

#signupForm::-webkit-scrollbar {
    width: 5px;
}

#signupForm::-webkit-scrollbar-thumb {
    background: rgba(255, 94, 26, 0.3);
    border-radius: 10px;
}

.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

@media (max-width: 540px) {
    .form-row-grid {
        grid-template-columns: 1fr;
    }
}

.modal-btn-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.btn-cancel {
    padding: 9px 16px;
    background: transparent;
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-submit-signup {
    padding: 9px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(255, 94, 26, 0.25);
}

.btn-submit-signup:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 94, 26, 0.35);
}

.success-msg {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    color: #10b981;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.4;
}

/* 📱 High Zoom (>150%) & Low Viewport Adapters for Login & Signup Modal */
@media (max-height: 620px) {
    .login-card {
        padding: 24px 24px 20px !important;
        border-radius: 18px !important;
    }

    .login-logo {
        margin-bottom: 14px !important;
    }

    .login-logo-img {
        max-width: 190px !important;
    }

    .login-title {
        font-size: 20px !important;
        margin-bottom: 2px !important;
    }

    .login-subtitle {
        font-size: 12.5px !important;
        margin-bottom: 16px !important;
    }

    .form-group-custom {
        margin-bottom: 12px !important;
    }

    .login-card .form-control-custom {
        padding: 9px 12px 9px 42px !important;
        font-size: 13px !important;
    }

    .login-card .form-control-custom.has-toggle {
        padding-right: 38px !important;
    }

    .password-toggle-btn {
        right: 8px !important;
        padding: 4px !important;
    }

    .password-toggle-btn svg {
        width: 16px !important;
        height: 16px !important;
    }

    .btn-login {
        padding: 10px !important;
        font-size: 13.5px !important;
    }

    .signup-divider {
        margin: 12px 0 8px !important;
    }

    .login-footer {
        margin-top: 14px !important;
        font-size: 11px !important;
    }

    .signup-modal-card {
        padding: 16px 20px !important;
        border-radius: 16px !important;
    }

    .signup-modal-title {
        font-size: 16px !important;
    }

    .signup-modal-desc {
        font-size: 12px !important;
        margin-bottom: 12px !important;
    }

    .form-row-grid {
        gap: 8px !important;
        margin-bottom: 8px !important;
    }

    .signup-modal-card .form-group-custom {
        margin-bottom: 8px !important;
    }

    .signup-modal-card .form-label-custom {
        font-size: 10.5px !important;
        margin-bottom: 3px !important;
    }

    .signup-modal-card .form-control-custom {
        padding: 8px 12px !important;
        font-size: 12.5px !important;
    }

    .modal-btn-actions {
        margin-top: 10px !important;
        padding-top: 10px !important;
    }

    .btn-cancel,
    .btn-submit-signup {
        padding: 8px 14px !important;
        font-size: 12.5px !important;
    }
}

@media (max-height: 520px) {
    .login-card {
        padding: 14px 18px 14px !important;
    }

    .login-logo {
        margin-bottom: 8px !important;
    }

    .login-logo-img {
        max-width: 150px !important;
    }

    .login-title {
        font-size: 17px !important;
    }

    .login-subtitle {
        margin-bottom: 10px !important;
    }

    .form-group-custom {
        margin-bottom: 8px !important;
    }
}