:root {
    --ma-primary: #1a365d;
    --ma-primary-light: #2c5282;
    --ma-accent: #f97316;
    --ma-success: #10b981;
    --ma-danger: #ef4444;
    --ma-surface: rgba(255,255,255,.96);
    --ma-text: #1f2937;
    --ma-muted: #6b7280;
    --ma-radius: 20px;
    --ma-shadow: 0 25px 50px -12px rgba(15,36,64,.25);
}

.member-auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: Sora, system-ui, sans-serif;
    color: var(--ma-text);
    background: #0f2440;
    overflow-x: hidden;
}

.member-auth-bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f2440 0%, #1a365d 45%, #2c5282 100%);
    z-index: 0;
}

.member-auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .45;
    animation: maFloat 12s ease-in-out infinite;
}
.member-auth-orb-1 { width: 320px; height: 320px; background: #f97316; top: -80px; right: -60px; }
.member-auth-orb-2 { width: 260px; height: 260px; background: #38bdf8; bottom: 10%; left: -80px; animation-delay: -4s; }
.member-auth-auth-orb-3 { width: 200px; height: 200px; background: #a78bfa; top: 40%; right: 20%; animation-delay: -8s; }

@keyframes maFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -30px) scale(1.08); }
}

.member-auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.member-auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--ma-surface);
    border-radius: var(--ma-radius);
    box-shadow: var(--ma-shadow);
    padding: 32px 28px 24px;
    animation: maSlideUp .6s cubic-bezier(.22,1,.36,1);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.6);
}

@keyframes maSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.member-auth-brand { text-align: center; margin-bottom: 20px; }
.member-auth-logo img { border-radius: 16px; box-shadow: 0 8px 24px rgba(26,54,93,.2); }
.member-auth-brand h1 { margin: 14px 0 4px; font-size: 1.5rem; color: var(--ma-primary); }
.member-auth-brand p { margin: 0; color: var(--ma-muted); font-size: .92rem; }

.member-auth-alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-size: .9rem;
    animation: maShake .4s ease;
}
.member-auth-alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.member-auth-alert-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

@keyframes maShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.member-auth-steps {
    display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 20px;
}
.member-auth-steps span {
    width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem; background: #e5e7eb; color: var(--ma-muted); transition: .3s;
}
.member-auth-steps span.active { background: var(--ma-accent); color: #fff; box-shadow: 0 4px 14px rgba(249,115,22,.4); }
.member-auth-step-line { width: 48px; height: 3px; background: #e5e7eb; border-radius: 2px; }

.member-auth-form-animate { animation: maFadeIn .5s ease .1s both; }
@keyframes maFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.member-auth-field { margin-bottom: 16px; }
.member-auth-field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--ma-primary); }
.member-auth-field label i { margin-right: 6px; color: var(--ma-accent); }
.member-auth-field .optional { font-weight: 400; color: var(--ma-muted); font-size: .8rem; }
.member-auth-field input[type="text"],
.member-auth-field input[type="email"],
.member-auth-field input[type="password"],
.member-auth-field input[type="tel"] {
    width: 100%; padding: 12px 14px; border: 2px solid #e5e7eb; border-radius: 12px;
    font-size: 1rem; transition: border-color .2s, box-shadow .2s; box-sizing: border-box;
}
.member-auth-field input:focus {
    outline: none; border-color: var(--ma-accent);
    box-shadow: 0 0 0 4px rgba(249,115,22,.15);
}

.member-auth-password-wrap { position: relative; }
.member-auth-password-wrap input { padding-right: 44px; }
.member-auth-toggle-pw {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    border: 0; background: none; color: var(--ma-muted); cursor: pointer; padding: 6px;
}

.member-auth-strength { height: 4px; background: #e5e7eb; border-radius: 2px; margin-top: 8px; overflow: hidden; }
.member-auth-strength span {
    display: block; height: 100%; width: 0; border-radius: 2px; transition: width .3s, background .3s;
}

.member-auth-check {
    display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; font-size: .88rem; cursor: pointer;
}
.member-auth-check input { margin-top: 3px; accent-color: var(--ma-accent); }
.member-auth-check a { color: var(--ma-primary-light); }

.member-auth-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 20px; border: 0; border-radius: 12px; font-size: 1rem; font-weight: 700;
    cursor: pointer; transition: transform .15s, box-shadow .2s;
}
.member-auth-btn-primary {
    background: linear-gradient(135deg, var(--ma-accent), #ea580c); color: #fff;
    box-shadow: 0 8px 20px rgba(249,115,22,.35);
}
.member-auth-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(249,115,22,.45); }
.member-auth-btn-danger { background: var(--ma-danger); color: #fff; }

.member-auth-switch { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--ma-muted); }
.member-auth-switch a { color: var(--ma-primary-light); font-weight: 600; text-decoration: none; }

.member-auth-footer { text-align: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid #e5e7eb; }
.member-auth-footer a { color: var(--ma-muted); text-decoration: none; font-size: .88rem; }

.member-auth-shield {
    width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%;
    background: linear-gradient(135deg, var(--ma-primary), var(--ma-primary-light));
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 2rem;
    animation: maPulse 2s ease infinite;
}
.member-auth-shield.success { background: linear-gradient(135deg, var(--ma-success), #059669); }

@keyframes maPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,.3); }
    50% { box-shadow: 0 0 0 16px rgba(249,115,22,0); }
}

.member-auth-totp-visual { text-align: center; margin-bottom: 20px; }
.member-auth-totp-visual p { font-size: .88rem; color: var(--ma-muted); margin: 0; }

.totp-input-group {
    display: flex; gap: 8px; justify-content: center;
}
.totp-input-group input {
    width: 46px; height: 52px; text-align: center; font-size: 1.4rem; font-weight: 700;
    border: 2px solid #e5e7eb; border-radius: 12px; transition: .2s;
}
.totp-input-group input:focus {
    border-color: var(--ma-accent); box-shadow: 0 0 0 4px rgba(249,115,22,.2); outline: none;
    transform: scale(1.05);
}
.totp-input-group input.filled { border-color: var(--ma-success); background: #ecfdf5; }

.member-auth-recovery { margin: 16px 0; font-size: .88rem; }
.member-auth-recovery summary { cursor: pointer; color: var(--ma-primary-light); font-weight: 600; }
.member-auth-recovery input { width: 100%; margin-top: 8px; padding: 10px; border-radius: 10px; border: 1px solid #e5e7eb; }

.member-totp-setup { text-align: center; }
.member-totp-qr-wrap { position: relative; display: inline-block; margin-bottom: 16px; }
.member-totp-qr { border-radius: 16px; border: 4px solid #fff; box-shadow: var(--ma-shadow); }
.member-totp-scan-line {
    position: absolute; left: 8%; right: 8%; height: 2px; background: var(--ma-accent);
    animation: maScan 2s linear infinite; opacity: .8;
}
@keyframes maScan {
    0% { top: 10%; }
    100% { top: 90%; }
}
.member-totp-secret { margin-bottom: 20px; }
.member-totp-secret code {
    display: block; padding: 10px; background: #f3f4f6; border-radius: 8px;
    font-size: .85rem; word-break: break-all; margin: 8px 0;
}
.member-auth-copy {
    border: 0; background: var(--ma-primary); color: #fff; padding: 8px 14px;
    border-radius: 8px; cursor: pointer; font-size: .85rem;
}

.member-security-nav {
    display: flex; gap: 8px; margin-bottom: 20px; justify-content: center;
}
.member-security-nav a {
    padding: 8px 14px; border-radius: 999px; text-decoration: none; font-size: .85rem;
    color: var(--ma-muted); background: #f3f4f6; transition: .2s;
}
.member-security-nav a.active { background: var(--ma-primary); color: #fff; }

.member-recovery-box {
    background: #fffbeb; border: 1px solid #fcd34d; border-radius: 12px; padding: 16px; margin-bottom: 20px;
}
.member-recovery-list { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.member-recovery-list code { background: #fff; padding: 6px 10px; border-radius: 6px; display: block; font-size: .85rem; }

/* Public profile area */
.member-area { padding: 40px 0 72px; background: var(--gray-50, #f4f6f9); min-height: 50vh; }
.member-flash {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px;
    margin-bottom: 20px; font-size: .92rem; font-weight: 500;
}
.member-flash-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.member-flash-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.member-area-header {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 28px;
    padding: 24px 28px; background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    border-radius: 16px; color: #fff; box-shadow: 0 8px 24px rgba(26,54,93,.2);
}
.member-area-avatar { font-size: 3.2rem; line-height: 1; opacity: .95; flex-shrink: 0; }
.member-area-user { flex: 1; min-width: 180px; }
.member-area-header h1 { margin: 0 0 4px; font-size: 1.45rem; font-weight: 700; color: #fff; }
.member-area-header p { margin: 0; opacity: .88; font-size: .95rem; }
.member-area-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.member-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px;
    border-radius: 10px; font-weight: 600; font-size: .88rem; text-decoration: none;
    transition: background .2s, border-color .2s, transform .15s;
}
.member-btn-light { background: #fff; color: #1a365d; border: 2px solid #fff; }
.member-btn-light:hover { background: #f0f4f8; transform: translateY(-1px); }
.member-btn-ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.45); }
.member-btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.member-area-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.member-panel {
    background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 2px 12px rgba(0,0,0,.06);
    border: 1px solid #e5e7eb;
}
.member-panel h2 { margin: 0 0 18px; font-size: 1.05rem; color: var(--ma-primary, #1a365d); font-weight: 700; }
.member-panel h2 i { color: var(--ma-accent, #f97316); margin-right: 8px; }
.member-panel-form .form-row { margin-bottom: 14px; }
.member-panel-form label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 6px; color: #374151; }
.member-panel-form input {
    width: 100%; padding: 11px 13px; border: 1px solid #d1d5db; border-radius: 10px;
    font-size: .95rem; box-sizing: border-box; transition: border-color .2s, box-shadow .2s;
}
.member-panel-form input:focus {
    outline: none; border-color: var(--ma-accent, #f97316);
    box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}
.member-panel-form input:disabled { background: #f3f4f6; color: #6b7280; cursor: not-allowed; }
.member-panel-form .btn { margin-top: 4px; }
.member-info-list { list-style: none; padding: 0; margin: 0; }
.member-info-list li {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid #f3f4f6; font-size: .92rem;
}
.member-info-list li:last-child { border-bottom: 0; }
.member-info-list span { color: #6b7280; }
.member-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
    border-radius: 999px; font-size: .82rem; font-weight: 600;
}
.member-badge-success { background: #d1fae5; color: #047857; }
.member-badge-muted { background: #f3f4f6; color: #6b7280; }
.member-link-security {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
    color: var(--ma-primary-light, #2c5282); font-weight: 600; font-size: .88rem; text-decoration: none;
}
.member-link-security:hover { color: var(--ma-accent, #f97316); }
@media (max-width: 640px) {
    .member-area-header { padding: 20px; }
    .member-area-actions { width: 100%; margin-left: 0; }
    .member-btn { flex: 1; justify-content: center; }
    .btn-member-app-label { display: none; }
    .member-app-banner { flex-direction: column; text-align: center; }
    .member-app-banner-btn { width: 100%; }
}

/* Member Android app */
.member-app-page { padding: 40px 0 72px; background: var(--gray-50, #f4f6f9); }
.member-app-hero {
    display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-bottom: 28px;
    padding: 28px 32px; background: linear-gradient(135deg, #1a365d 0%, #2c5282 55%, #1a365d 100%);
    border-radius: 20px; color: #fff; box-shadow: 0 12px 32px rgba(26,54,93,.22);
    border: 2px solid rgba(201, 162, 39, .35);
}
.member-app-hero-logo img {
    width: 120px; height: 120px; object-fit: contain; border-radius: 20px;
    background: #fff; padding: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.member-app-hero-text { flex: 1; min-width: 220px; }
.member-app-badge {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
    background: rgba(201, 162, 39, .2); border: 1px solid rgba(201, 162, 39, .5);
    border-radius: 999px; font-size: .82rem; font-weight: 600; color: #e8c547; margin-bottom: 10px;
}
.member-app-hero h1 { margin: 0 0 8px; font-size: 1.65rem; color: #fff; }
.member-app-hero p { margin: 0; opacity: .9; line-height: 1.6; }
.member-app-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 20px; }
.member-app-card {
    background: #fff; border-radius: 16px; padding: 24px; border: 1px solid #e5e7eb;
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.member-app-card h2, .member-app-card h3 { margin: 0 0 16px; color: #1a365d; font-size: 1.05rem; }
.member-app-card h2 i, .member-app-card h3 i { color: #c9a227; margin-right: 8px; }
.member-app-features { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.member-app-features li { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: #374151; }
.member-app-features i { color: #10b981; }
.member-app-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 20px; font-size: .88rem; color: #6b7280; }
.member-app-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.member-app-download-btn { font-size: 1.05rem; padding: 14px 24px; }
.member-app-steps { padding-left: 18px; line-height: 1.7; color: #374151; margin: 0 0 18px; font-size: .9rem; }
.member-app-security {
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px; padding: 14px;
    margin-bottom: 16px; font-size: .88rem; color: #374151;
}
.member-app-security h4 { margin: 0 0 6px; color: #1e40af; font-size: .92rem; }
.member-app-security p { margin: 0; line-height: 1.5; }
.member-app-qr-wrap { text-align: center; padding-top: 12px; border-top: 1px dashed #e5e7eb; }
.member-app-qr { display: inline-block; min-height: 180px; min-width: 180px; }
.member-app-qr-note { margin: 10px 0 0; font-size: .82rem; color: #6b7280; }
.member-app-banner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-bottom: 24px;
    padding: 22px 24px; background: #fff; border-radius: 16px; border: 2px solid #c9a227;
    box-shadow: 0 4px 16px rgba(201, 162, 39, .12);
}
.member-app-banner-logo img {
    width: 72px; height: 72px; object-fit: contain; border-radius: 12px; background: #f9fafb; padding: 4px;
}
.member-app-banner-body { flex: 1; min-width: 220px; }
.member-app-banner-body h3 { margin: 0 0 6px; color: #1a365d; font-size: 1rem; }
.member-app-banner-body p { margin: 0; color: #6b7280; font-size: .88rem; line-height: 1.5; }
.member-app-banner-version { margin-top: 8px !important; font-size: .8rem !important; color: #9ca3af !important; }
.member-app-banner-aside { flex-shrink: 0; text-align: center; }
.member-app-banner-btn { white-space: nowrap; }
.member-app-qr-desktop { text-align: center; }
.member-app-qr { display: inline-block; min-width: 168px; min-height: 168px; background: #fff; border-radius: 12px; padding: 8px; border: 1px solid #e5e7eb; }
.member-app-qr-caption { margin: 8px 0 0; font-size: .82rem; color: #1a365d; font-weight: 600; }
.member-app-banner-desc-mobile { display: none; }
.member-app-download-mobile { display: none; }
@media (max-width: 768px) {
    .member-app-banner { flex-direction: column; text-align: center; }
    .member-app-banner-desc-desktop { display: none; }
    .member-app-banner-desc-mobile { display: block; }
    .member-app-qr-desktop { display: none; }
    .member-app-download-mobile { display: inline-flex; margin-top: 4px; }
    .member-app-banner-aside { width: 100%; }
}
@media (max-width: 900px) {
    .member-app-grid { grid-template-columns: 1fr; }
    .member-app-hero { padding: 22px; }
}

@media (max-width: 480px) {
    .member-auth-card { padding: 24px 18px; }
    .totp-input-group input { width: 40px; height: 48px; font-size: 1.2rem; }
}
