:root {
    --purple-dark: #301249;
    --purple: #7a3cf0;
    --purple-2: #8f46ff;
    --gold: #ffc63f;
    --panel: #11131d;
    --panel-2: #151825;
    --border: #282d43;
    --text: #f5f6fb;
    --muted: #aeb3c2;
    --bg: #05060a;
    --placeholder: #6a718b;
}

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

body {
    min-height: 100vh;
    background-color: var(--bg);
    font-family: 'Inter', sans-serif;
    overflow-y: auto;
    position: relative;
    color: var(--text);
}

.bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #0a0c16 0%, var(--bg) 100%);
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.6;
}

.blob1 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(122, 60, 240, 0.4), transparent 70%);
    top: -200px;
    left: -150px;
    animation: drift1 18s ease-in-out infinite;
}

.blob2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(143, 70, 255, 0.35), transparent 70%);
    bottom: -150px;
    right: -100px;
    animation: drift2 22s ease-in-out infinite;
}

.blob3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 198, 63, 0.15), transparent 70%);
    top: 45%;
    left: 55%;
    animation: drift3 26s ease-in-out infinite;
}

@keyframes drift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 40px) scale(1.05); }
}

@keyframes drift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-40px, -50px) scale(1.1); }
}

@keyframes drift3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 30px); }
}

.bg-canvas::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1.5px, transparent 1.5px);
    background-size: 20px 20px;
    opacity: 0.7;
    pointer-events: none;
}

.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    bottom: -20px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--purple-2);
    box-shadow: 0 0 10px var(--purple-2);
    opacity: 0;
    animation: floatUp linear infinite;
}

.particle.gold {
    background: var(--gold);
    box-shadow: 0 0 10px var(--gold);
}

@keyframes floatUp {
    0% { bottom: -20px; opacity: 0; transform: translateX(0); }
    10% { opacity: 0.8; }
    90% { opacity: 0.4; }
    100% { bottom: 110%; opacity: 0; transform: translateX(40px); }
}

.page-wrapper {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: rgba(17, 19, 29, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 44px 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: cardIn 0.8s cubic-bezier(.22, 1, .36, 1) both;
    position: relative;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(143, 70, 255, 0.4), transparent 50%, rgba(255, 198, 63, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.logo-wrap {
    text-align: center;
    margin-bottom: 30px;
}

.logo-wrap img {
    height: 60px;
    object-fit: contain;
    animation: floatLogo 4s ease-in-out infinite;
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.portal-label {
    margin-top: 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--gold), #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.section-divider span {
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
    white-space: nowrap;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label-custom {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 15px;
    pointer-events: none;
    transition: color 0.3s;
}

.form-control-custom {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: all 0.3s ease;
}

.form-control-custom:focus {
    border-color: var(--purple-2);
    background: rgba(143, 70, 255, 0.05);
    box-shadow: 0 0 0 4px rgba(143, 70, 255, 0.15);
}

.form-control-custom:focus ~ .input-icon,
.input-wrap:focus-within .input-icon {
    color: var(--purple-2);
}

.form-control-custom::placeholder {
    color: var(--placeholder);
    font-weight: 400;
}

.form-control-custom:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 16px;
    color: var(--muted);
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--purple-2);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-2) 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(122, 60, 240, 0.3);
    margin-top: 8px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.btn-login::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    border-radius: inherit;
    pointer-events: none;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(122, 60, 240, 0.45);
    filter: brightness(1.1);
}

.btn-login:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.footer-row {
    text-align: center;
}

.lost-pw {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.lost-pw:hover {
    color: var(--gold);
}

.alert-area {
    margin-bottom: 20px;
}

.alert-area .alert {
    border-radius: 12px;
    font-size: 13px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.alert-area .alert-danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-area .alert-warning {
    border-color: rgba(242, 191, 40, 0.3);
    color: #fde68a;
}

.alert-area .alert-info {
    border-color: rgba(14, 165, 233, 0.2);
    color: #bae6fd;
}

.alert-area .alert-success {
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.field-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

.otp-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.resend-link {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: none;
    color: var(--gold);
    -webkit-text-fill-color: var(--gold);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    opacity: 1;
}

.resend-link:disabled,
.resend-link.is-cooling {
    color: var(--muted);
    -webkit-text-fill-color: var(--muted);
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.resend-timer {
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: var(--gold);
    -webkit-text-fill-color: var(--gold);
    white-space: nowrap;
}

.success-panel {
    text-align: center;
}

.success-panel i {
    font-size: 42px;
    color: #86efac;
    margin-bottom: 16px;
}

.success-panel p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

@media (max-width: 480px) {
    .login-card {
        padding: 32px 22px 28px;
    }
}
