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

* { margin: 0; padding: 0; box-sizing: border-box; }

.login-body {
    font-family: 'Montserrat', sans-serif;
    background-image: url('/assets/imgs/loginbanner.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Floating Cards Animation */
.floating-cards {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    animation: fadeOutCards 1.5s ease-out 10s forwards;
}
@keyframes fadeOutCards {
    to { opacity: 0; }
}
.floating-card {
    position: absolute;
    width: 90px;
    height: 58px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    opacity: 0;
    animation: floatCard ease-in-out forwards;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.floating-card::before {
    content: '';
    position: absolute;
    top: 7px; left: 8px;
    width: 16px; height: 11px;
    border-radius: 2px;
    background: rgba(255,215,0,0.5);
    border: 1px solid rgba(255,215,0,0.3);
}
.floating-card::after {
    position: absolute;
    bottom: 6px; left: 8px;
    font-size: 7px;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.4);
    font-weight: 400;
}
/* Visa - blue gradient */
.fc1 { left: 3%; background: linear-gradient(135deg, #1a1f71, #2b4acb); animation-duration: 8s; animation-delay: 0s; }
.fc1::after { content: '4512 •••• ••••'; }
/* Mastercard - official red & yellow */
.fc2 { left: 88%; background: linear-gradient(135deg, #eb001b, #f79e1b); animation-duration: 9s; animation-delay: 0.5s; }
.fc2::after { content: '5412 •••• ••••'; }
/* Amex - green */
.fc3 { left: 20%; background: linear-gradient(135deg, #006fcf, #00aaff); animation-duration: 7s; animation-delay: 1.5s; }
.fc3::after { content: '3742 •••• ••••'; }
/* Discover - orange */
.fc4 { left: 60%; background: linear-gradient(135deg, #d35400, #f39c12); animation-duration: 10s; animation-delay: 0.8s; }
.fc4::after { content: '6011 •••• ••••'; }
/* Visa */
.fc5 { left: 75%; background: linear-gradient(135deg, #1a1f71, #4169e1); animation-duration: 8.5s; animation-delay: 2s; }
.fc5::after { content: '4024 •••• ••••'; }
/* Mastercard */
.fc6 { left: 10%; background: linear-gradient(135deg, #eb001b, #ff5f00); animation-duration: 9.5s; animation-delay: 1s; }
.fc6::after { content: '5567 •••• ••••'; }

@keyframes floatCard {
    0% {
        transform: translateY(105vh) rotate(5deg);
        opacity: 0;
    }
    8% { opacity: 0.7; }
    50% {
        transform: translateY(40vh) rotate(-8deg) translateX(25px);
        opacity: 0.55;
    }
    92% { opacity: 0.5; }
    100% {
        transform: translateY(-15vh) rotate(12deg) translateX(-15px);
        opacity: 0;
    }
}

/* Glass Card */
.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: rgba(0, 0, 0, 0.78);
    padding: 34px 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.08);
}

/* Logo */
.login-header {
    text-align: center;
    margin-bottom: 10px;
}
.login-logo {
    width: 190px;
    height: auto;
    margin-bottom: 12px;
}
.login-subtitle {
    font-size: 15px;
    color: #ccc;
    line-height: 1.5;
    margin-bottom: 10px;
}
.login-subtitle a {
    color: #00c4ff;
    font-weight: 600;
    text-decoration: none;
}
.login-subtitle a:hover { text-decoration: underline; }

/* Tabs */
.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255,255,255,0.15);
}
.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-weight: 600;
    font-size: 15px;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    text-decoration: none;
}
.auth-tab:hover { color: rgba(255,255,255,0.8); text-decoration: none; }
.auth-tab.active { color: #fff; border-bottom-color: #00c4ff; }

/* Forms */
.auth-form { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
.auth-form.active { position: static; left: auto; opacity: 1; pointer-events: auto; }

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

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: background 0.3s;
}
.form-control:focus {
    background: rgba(255, 255, 255, 0.22);
}
.form-control::placeholder { color: rgba(255,255,255,0.35); }

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
    background: linear-gradient(135deg, #1F8A70 0%, #0B3D2E 50%, #1a3a6c 100%);
    color: #fff;
    font-family: inherit;
    letter-spacing: 0.5px;
}
.btn-primary:hover { background: linear-gradient(135deg, #176b57 0%, #092e22 50%, #152d54 100%); }

.btn-full { width: 100%; }

/* Footer links */
.login-footer {
    text-align: center;
    margin-top: 14px;
}
.login-footer a {
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}
.login-footer a:hover { color: #fff; }

/* Alerts */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 500;
}
.alert-success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.4);
    color: #7dffaa;
}
.alert-danger {
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 0, 0, 0.35);
    color: #ffbaba;
}

/* Recovery key */
.recovery-key-box {
    display: flex;
    gap: 8px;
}
.recovery-key-input {
    flex: 1;
    font-family: monospace !important;
    font-size: 13px !important;
    background: rgba(255,255,255,0.08) !important;
}
.copy-btn {
    padding: 8px 14px;
    background: #1F8A70;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    font-weight: 600;
    font-size: 12px;
}
.copy-btn:hover { background: #176b57; }

.field-hint {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}
.field-hint.danger { color: #ff6b6b; font-weight: 600; font-size: 13px; }

/* Floating Walter White SVGs */
.floating-walter {
    position: absolute;
    width: 50px;
    height: 50px;
    opacity: 0;
    animation: floatWalter ease-in-out forwards;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}
.fw1 { left: 8%; animation-duration: 9s; animation-delay: 2s; width: 75px; height: 75px; }
.fw2 { left: 48%; animation-duration: 11s; animation-delay: 4s; width: 65px; height: 65px; }
.fw3 { left: 82%; animation-duration: 8s; animation-delay: 1s; width: 70px; height: 70px; }

@keyframes floatWalter {
    0% {
        transform: translateY(110vh) rotate(0deg);
        opacity: 0;
    }
    8% { opacity: 0.85; }
    50% {
        transform: translateY(45vh) rotate(10deg) translateX(20px);
        opacity: 0.75;
    }
    92% { opacity: 0.8; }
    100% {
        transform: translateY(-10vh) rotate(-8deg) translateX(-15px);
        opacity: 0;
    }
}

/* Captcha */
.captcha-group { margin-bottom: 14px; }
.captcha-img {
    height: 45px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.15);
    transition: opacity 0.2s;
}
.captcha-img:hover { opacity: 0.8; }

/* Responsive - adapts to all screen sizes */

/* Large desktop (1440px+) - box stays centered and comfortable */
@media (min-width: 1440px) {
    .login-container { max-width: 460px; }
    .login-box { padding: 38px 34px; }
    .login-logo { width: 200px; }
}

/* Standard desktop/laptop (1024-1439px) */
@media (max-width: 1439px) {
    .login-container { max-width: 420px; }
    .login-box { padding: 30px 28px; }
}

/* Small laptop / tablet landscape (768-1023px) */
@media (max-width: 1023px) {
    .login-container { max-width: 400px; }
    .login-box { padding: 28px 24px; }
    .login-logo { width: 160px; }
    .login-subtitle { font-size: 13px; }
}

/* Tablet portrait (600-767px) */
@media (max-width: 767px) {
    .login-container { max-width: 380px; padding: 16px; }
    .login-box { padding: 24px 20px; }
    .login-logo { width: 140px; }
    .login-subtitle { font-size: 12px; }
    .form-label { font-size: 12px; }
    .form-control { padding: 10px 12px; font-size: 13px; }
    .btn-primary { padding: 10px; font-size: 14px; }
    .auth-tab { font-size: 14px; padding: 8px 0; }
    .floating-cards { display: none; }
}

/* Mobile (481-599px) */
@media (max-width: 599px) {
    .login-container { max-width: 100%; padding: 12px; }
    .login-box { padding: 22px 18px; border-radius: 12px; }
    .login-logo { width: 130px; }
    .field-hint { font-size: 10px; }
    .recovery-key-input { font-size: 11px !important; }
    .floating-cards { display: none; }
}

/* Small mobile (480px and below) */
@media (max-width: 480px) {
    .login-container { padding: 8px; }
    .login-box { padding: 20px 16px; }
    .login-logo { width: 110px; }
    .login-subtitle { font-size: 11px; }
    .form-control { padding: 9px 10px; font-size: 13px; }
    .btn-primary { padding: 10px; font-size: 13px; }
    .auth-tab { font-size: 13px; }
    .captcha-img { max-width: 140px; height: auto; }
    .floating-cards { display: none; }
}

/* Very small mobile (360px and below) */
@media (max-width: 360px) {
    .login-container { padding: 6px; }
    .login-box { padding: 16px 12px; }
    .login-logo { width: 90px; }
    .recovery-key-input { font-size: 10px !important; }
}

/* Height-based: small screens (laptops with low res) - make box scroll if needed */
@media (max-height: 700px) {
    .login-body { align-items: flex-start; padding-top: 20px; }
    .login-box { padding: 22px 22px; }
    .login-logo { width: 130px; margin-bottom: 8px; }
    .login-subtitle { margin-bottom: 6px; font-size: 12px; }
    .form-group { margin-bottom: 10px; }
    .login-header { margin-bottom: 6px; }
}

@media (max-height: 600px) {
    .login-body { align-items: flex-start; padding-top: 10px; }
    .login-box { padding: 18px 18px; }
    .login-logo { width: 100px; margin-bottom: 6px; }
    .form-group { margin-bottom: 8px; }
}
