/* =========================================================
   PROFILE PAGE (sign in / create account / profile)
   Works on top of the shared style.css
   (navbar, footer, theme and base colors come from there)
========================================================= */

/* Page-only tokens (scoped so the shared navbar/footer are not affected) */
.profile-page {
    --surface-2: var(--surface-soft);
    --primary-soft: var(--tint-blue);
    --danger: #d92d20;
    --success: #12b76a;
    --shadow: 0 24px 70px rgba(16, 24, 40, 0.10);

    min-height: calc(100vh - 74px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    font-family: Arial, Helvetica, sans-serif;
    line-height: normal;
}

:root[data-theme="dark"] .profile-page {
    --danger: #ff8b8b;
    --success: #5fe0c5;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

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

.profile-page button,
.profile-page input {
    font: inherit;
}

.profile-page .hidden,
.profile-page [hidden] {
    display: none !important;
}


/* PROFILE CARD */

.profile-card {
    width: 100%;
    max-width: 470px;
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.profile-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--ink-blue);
}

.profile-icon svg {
    width: 34px;
    height: 34px;
}

/* The profile view has its own check icon */
.profile-card.is-profile .profile-icon {
    display: none;
}


/* HEADINGS */

.profile-card h1 {
    margin-bottom: 8px;
    text-align: center;
    font-size: 28px;
}

.subtitle {
    margin-bottom: 30px;
    text-align: center;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}


/* FORM */

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper > svg {
    position: absolute;
    left: 14px;
    width: 19px;
    height: 19px;
    color: var(--muted);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    height: 48px;
    padding: 0 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(23, 105, 224, 0.15);
}

.input-wrapper input::placeholder {
    color: var(--muted);
    opacity: 0.75;
}


/* PASSWORD TOGGLE */

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border: none;
    background: none;
    color: var(--muted);
    transform: translateY(-50%);
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--ink-blue);
}

.password-toggle svg {
    width: 19px;
    height: 19px;
}

.password-toggle .icon-hide,
.password-toggle.is-visible .icon-show {
    display: none;
}

.password-toggle.is-visible .icon-hide {
    display: block;
}


/* BUTTONS */

.primary-button {
    width: 100%;
    min-height: 48px;
    margin-top: 5px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.primary-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.primary-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}


/* MESSAGES */

.message {
    min-height: 20px;
    margin-top: 12px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.message.error {
    color: var(--danger);
}

.message.success {
    color: var(--success);
}


/* SWITCH SIGN IN / SIGN UP */

.switch-section {
    margin-top: 25px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.link-button {
    margin-left: 4px;
    border: none;
    background: none;
    color: var(--ink-blue);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.link-button:hover {
    text-decoration: underline;
}


/* ADMIN LOGIN BUTTON */

.admin-login-section {
    width: 100%;
    margin-top: 26px;
}

.admin-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.admin-divider::before,
.admin-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.admin-divider span {
    letter-spacing: 1px;
}

.admin-login-button {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-login-button > svg:first-child {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    padding: 9px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--ink-blue);
}

.admin-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.admin-text strong {
    font-size: 15px;
}

.admin-text small {
    color: var(--muted);
    font-size: 12px;
}

.admin-login-button .admin-arrow {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

.admin-login-button:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(23, 105, 224, 0.12);
}

.admin-login-button:hover .admin-arrow {
    transform: translateX(4px);
    color: var(--ink-blue);
}

.admin-login-button:focus-visible,
.link-button:focus-visible,
.logout-button:focus-visible {
    outline: 3px solid #f2b630;
    outline-offset: 3px;
}

/* Dashboard shortcut inside the profile view */
.admin-dashboard-button {
    margin-bottom: 12px;
}


/* PROFILE VIEW */

.success-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(18, 183, 106, 0.12);
    color: var(--success);
}

.success-icon svg {
    width: 35px;
    height: 35px;
}

.profile-info {
    margin-bottom: 22px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-2);
}

.info-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: none;
}

.info-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--ink-blue);
}

.info-icon svg {
    width: 19px;
    height: 19px;
}

.info-label {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 12px;
}

.info-row strong {
    font-size: 14px;
    word-break: break-word;
}


/* LOG OUT */

.logout-button {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--danger);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.logout-button:hover {
    border-color: var(--danger);
    background: rgba(217, 45, 32, 0.08);
}

.logout-button svg {
    width: 18px;
    height: 18px;
}


/* BACK LINK */

.back-link {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--ink-blue);
    font-size: 14px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.back-link:hover {
    opacity: 0.8;
}

.back-link svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}


/* MOBILE */

@media (max-width: 600px) {

    .profile-page {
        padding: 20px 15px;
        align-items: flex-start;
    }

    .profile-card {
        margin: auto 0;
        padding: 30px 22px;
        border-radius: 20px;
    }

    .profile-card h1 {
        font-size: 25px;
    }

    .subtitle {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .profile-page * {
        transition: none !important;
    }
}