/* =============================================================
   Unipoly Staking Programme — Login Page Styles
   ============================================================= */

html.login-page,
html.login-page body {
    overflow: hidden;
    height: 100%;
}

/* ---- Layout ---- */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 40px;
    position: relative;
    z-index: 1;
}

.card-wrapper {
    width: 100%;
    max-width: 460px;
    position: relative;
}

/* ---- Login Card (Step 1) ---- */
.login-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 32px 36px;
    opacity: 0;
    animation: fadeInScale 0.8s ease forwards;
    animation-delay: 0.2s;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.login-card.fade-out {
    opacity: 0 !important;
    transform: translateY(-20px) scale(0.97);
    pointer-events: none;
}

/* ---- PIN Card (Step 2) ---- */
.pin-card {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 32px 36px;
    opacity: 0;
    transform: translateY(30px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

.pin-card.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    position: relative;
}

/* ---- Step Indicator ---- */

/* ---- Brand Header ---- */
.brand-header {
    text-align: center;
    margin-bottom: 20px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(251, 191, 36, 0.08));
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 20px;
    margin-bottom: 12px;
}

.brand-badge i {
    font-size: 14px;
    color: #fbbf24;
}

.brand-badge span {
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: #fbbf24;
    letter-spacing: 2px;
}

.brand-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffffff 0%, #fbbf24 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
    margin-bottom: 6px;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--text-dim);
}

/* ---- Logo Showcase ---- */
.logo-area {
    text-align: center;
    margin-bottom: 20px;
}

.logo-showcase {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 800px;
}

.logo-orbit {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}

.orbit-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.orbit-ring-1 {
    inset: 18px;
    border: 1.5px solid rgba(251, 191, 36, 0.4);
    animation: orbitSpin1 7s linear infinite;
}

.orbit-ring-1::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    background: #fbbf24;
    border-radius: 50%;
    box-shadow: 0 0 16px 5px rgba(251, 191, 36, 0.9);
}

.orbit-ring-2 {
    inset: 4px;
    border: 1px dashed rgba(167, 139, 250, 0.2);
    animation: orbitSpin2 11s linear infinite reverse;
}

.orbit-ring-3 {
    inset: -4px;
    border: 1px solid rgba(251, 191, 36, 0.1);
    animation: orbitSpin3 15s linear infinite;
}

@keyframes orbitSpin1 {
    from { transform: rotateX(70deg) rotateZ(0deg); }
    to   { transform: rotateX(70deg) rotateZ(360deg); }
}

@keyframes orbitSpin2 {
    from { transform: rotateX(60deg) rotateY(30deg) rotateZ(0deg); }
    to   { transform: rotateX(60deg) rotateY(30deg) rotateZ(360deg); }
}

@keyframes orbitSpin3 {
    from { transform: rotateX(50deg) rotateY(-20deg) rotateZ(0deg); }
    to   { transform: rotateX(50deg) rotateY(-20deg) rotateZ(360deg); }
}

.logo-aura {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.5) 0%, rgba(251, 191, 36, 0.2) 40%, transparent 70%);
    filter: blur(22px);
    animation: auraPulse 3s ease-in-out infinite;
}

@keyframes auraPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50%       { transform: scale(1.8); opacity: 1; }
}

.logo-img-wrap {
    position: relative;
    z-index: 5;
    opacity: 0;
    animation:
        logoReveal 1.3s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards,
        proFloat   5s   ease-in-out 1.9s infinite;
}

@keyframes logoReveal {
    0%   { opacity: 0; transform: scale(0) rotate(-20deg); }
    50%  { opacity: 1; transform: scale(1.2) rotate(3deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes proFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-12px) scale(1.05); }
}

.logo-img-wrap img { height: 64px; }

/* ---- Auth Buttons ---- */
.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-btn {
    position: relative;
    width: 100%;
    height: 54px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.5s ease forwards;
    animation-delay: 0.5s;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.auth-btn:hover::before { left: 100%; }
.auth-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-purple); }
.auth-btn:active { transform: scale(0.98); }

.auth-btn.btn-google {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.15) 0%, rgba(234, 67, 53, 0.15) 100%);
    border-color: rgba(66, 133, 244, 0.3);
}

.auth-btn.btn-google:hover {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.25) 0%, rgba(234, 67, 53, 0.25) 100%);
    border-color: rgba(66, 133, 244, 0.5);
    box-shadow: 0 15px 40px -10px rgba(66, 133, 244, 0.3);
}

.google-svg { width: 24px; height: 24px; }

/* ---- Security Badge ---- */
.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 16px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
    animation-delay: 0.8s;
}

.security-badge i { color: #22c55e; font-size: 18px; }
.security-badge span { font-size: 13px; color: var(--text-muted); }

.terms-text {
    text-align: center;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 12px;
    line-height: 1.5;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
    animation-delay: 0.9s;
}

.terms-text a { color: var(--text-muted); text-decoration: underline; }
.terms-text a:hover { color: var(--purple-light); }

/* ---- Signed-in indicator ---- */

/* ---- PIN Header ---- */
.pin-header {
    text-align: center;
    margin-bottom: 20px;
}

.pin-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.1));
    border: 2px solid rgba(251, 191, 36, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    animation: iconPulse 2.5s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.2); }
    50%       { box-shadow: 0 0 40px rgba(251, 191, 36, 0.45); }
}

.pin-icon i { font-size: 32px; color: #fbbf24; }

.pin-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.pin-header p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.pin-header p strong { color: #fbbf24; }

/* ---- PIN Digit Display ---- */
.pin-digits {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.pin-digit {
    width: 48px;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    transition: all 0.2s ease;
}

.pin-digit.filled {
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.pin-digit.active {
    border-color: rgba(251, 191, 36, 0.8);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15);
}

/* ---- PIN Error ---- */
.pin-error {
    display: none;
    text-align: center;
    font-size: 13px;
    color: #ef4444;
    margin-bottom: 12px;
    animation: shake 0.4s ease;
}

.pin-error.show { display: block; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ---- PIN Keypad ---- */
.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 280px;
    margin: 0 auto 20px;
}

.key-btn {
    height: 56px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-btn:hover {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

.key-btn:active {
    transform: scale(0.95);
    background: rgba(251, 191, 36, 0.2);
}

.key-btn.key-del { font-size: 22px; }

.key-btn.key-submit {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    border-color: transparent;
    color: #78350f;
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0.35;
    pointer-events: none;
    transition: all 0.3s ease;
}

.key-btn.key-submit.ready {
    opacity: 1;
    pointer-events: auto;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.4);
}

.key-btn.key-submit.ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(251, 191, 36, 0.5);
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .login-container { padding: 16px; }
    .login-card, .pin-card { padding: 24px 20px; border-radius: 24px; }
    .pin-digit { width: 40px; height: 48px; font-size: 16px; }
    .key-btn { height: 50px; font-size: 16px; }
    .brand-title { font-size: 17px; }
}

/* ---- Light Theme ---- */
[data-theme="light"] .login-card,
[data-theme="light"] .pin-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .brand-title {
    background: linear-gradient(135deg, #1a1a2e 0%, #d97706 50%, #6c50bf 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .auth-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--border-light);
    color: var(--text-primary);
}

[data-theme="light"] .auth-btn.btn-google {
    background: rgba(66, 133, 244, 0.06);
    border-color: rgba(66, 133, 244, 0.2);
}

[data-theme="light"] .pin-digit {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

[data-theme="light"] .pin-header h2 { color: var(--text-primary); }

[data-theme="light"] .key-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--border-light);
    color: var(--text-primary);
}
