/* ============================================
   PORTAL STYLES
   shared/portal.css
   ============================================ */

/* --------------------------------------------
   Portal Layout
   -------------------------------------------- */
body.portal-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* Ambient background glow */
body.portal-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99, 102, 241, 0.08), transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 50%, rgba(99, 102, 241, 0.04), transparent 50%),
        radial-gradient(ellipse 60% 50% at 20% 80%, rgba(99, 102, 241, 0.03), transparent 50%);
    pointer-events: none;
}

/* Noise texture overlay */
body.portal-page::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
}

/* --------------------------------------------
   Motto - IMPROVED VISIBILITY
   -------------------------------------------- */
.motto {
    position: relative;
    z-index: 1;
    margin-bottom: 40px;
    text-align: center;
    animation: fadeIn 1.5s ease-out forwards;
}

.motto-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 15px;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    animation: glow 6s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.15);
}

.motto-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 14px;
}

.motto-line {
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
}

.motto-symbol {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* --------------------------------------------
   Portal Container & Card
   -------------------------------------------- */
.portal-container {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.portal-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    animation: fadeIn 0.6s ease-out;
}

.portal-card-header {
    text-align: center;
    margin-bottom: 32px;
}

.portal-card-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 8px 24px -8px rgba(99, 102, 241, 0.4);
}

.portal-card-header h1 {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.portal-card-header p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 300;
}

/* --------------------------------------------
   Auth Steps
   -------------------------------------------- */
.auth-step {
    display: none;
}

.auth-step.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

/* --------------------------------------------
   OTP Input
   -------------------------------------------- */
.otp-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.otp-input {
    width: 48px;
    height: 56px;
    background: var(--bg-element);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: 'Outfit', monospace;
    font-size: 22px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
}

.otp-input:hover {
    border-color: var(--border-hover);
}

.otp-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

/* --------------------------------------------
   Remember Device Checkbox
   -------------------------------------------- */
.remember-device {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    cursor: pointer;
}

.remember-device input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    background: var(--bg-element);
    border: 1px solid var(--border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-custom svg {
    width: 12px;
    height: 12px;
    stroke: white;
    stroke-width: 3;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.15s ease;
}

.remember-device input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--accent);
    border-color: var(--accent);
}

.remember-device input[type="checkbox"]:checked + .checkbox-custom svg {
    opacity: 1;
    transform: scale(1);
}

.remember-device:hover .checkbox-custom {
    border-color: var(--border-hover);
}

.remember-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
    user-select: none;
}

/* --------------------------------------------
   Projects Grid
   -------------------------------------------- */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.project-card {
    position: relative;
    padding: 20px 16px;
    background: var(--bg-element);
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

.project-card:hover:not(.locked) {
    border-color: var(--border-hover);
    background: var(--bg-element-hover);
    transform: translateY(-2px);
}

.project-card.selected {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -8px rgba(99, 102, 241, 0.3);
}

.project-card.locked {
    cursor: not-allowed;
    opacity: 0.4;
}

.project-card.locked .project-icon {
    filter: grayscale(1);
}

.project-card.locked.admin-override {
    cursor: pointer;
    opacity: 0.5;
}

.project-card.locked.admin-override:hover {
    opacity: 0.7;
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.project-card.locked.admin-override.selected {
    opacity: 0.8;
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -8px rgba(99, 102, 241, 0.3);
}

.project-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: filter 0.25s;
}

.project-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text);
}

.project-desc {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.4;
}

.project-card.locked .project-name,
.project-card.locked .project-desc {
    color: var(--text-muted);
}

.lock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.admin-badge {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 4px;
    font-size: 9px;
    font-weight: 500;
    color: #a5b4fc;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.2s;
}

.project-card.locked.admin-override:hover .admin-badge {
    opacity: 1;
}

/* --------------------------------------------
   No Access State
   -------------------------------------------- */
.no-access {
    text-align: center;
    padding: 20px 0;
}

.no-access-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: var(--bg-element);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    opacity: 0.6;
}

.no-access h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.no-access p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-weight: 300;
}

/* --------------------------------------------
   Session Indicator
   -------------------------------------------- */
.session-indicator {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
}

.session-indicator.visible {
    opacity: 1;
}

.session-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.session-actions {
    display: flex;
    gap: 8px;
    margin-left: 8px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}

.session-btn {
    padding: 4px 10px;
    background: var(--bg-element);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.session-btn:hover {
    background: var(--bg-element-hover);
    color: var(--text);
}

/* --------------------------------------------
   Responsive
   -------------------------------------------- */
@media (max-width: 480px) {
    .motto {
        margin-bottom: 32px;
    }

    .motto-text {
        font-size: 12px;
        letter-spacing: 0.25em;
    }

    .portal-card {
        padding: 32px 24px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .otp-input {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }

    .session-indicator {
        bottom: 16px;
        left: 16px;
        right: 16px;
        transform: none;
        justify-content: center;
    }
}
