@import url('theme.css');

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    color: #fff;
    background: var(--totp-gradient);
    background-size: 400% 400%;
    animation: totp-gradient-shift var(--totp-shift-duration) ease infinite;
    line-height: 1.5;
}

a { color: #fff; text-decoration: none; }
a:hover { text-decoration: underline; }

.app-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Nav ── */
.app-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
}

.app-nav-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.25rem;
    min-height: 64px;
    display: flex;
    align-items: center;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none !important;
    color: #fff !important;
}

.app-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.app-brand-name {
    font-weight: 700;
    font-size: 1rem;
}

.app-brand-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
}

.app-brand-by {
    font-size: 0.68rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
}

/* ── Main: original compact card ── */
.app-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.75rem 1.25rem 2rem;
}

.card {
    width: 100%;
    max-width: 420px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 1.5rem 1.25rem 1.25rem;
    backdrop-filter: blur(6px);
    text-align: center;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

/* Timer above code */
.timer {
    margin-bottom: 0.9rem;
}

.timer span {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-variant-numeric: tabular-nums;
}

.progress {
    margin: 0.5rem auto 0;
    max-width: 180px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

.progress > span {
    display: block;
    height: 100%;
    background: var(--totp-accent);
    border-radius: 999px;
    transition: width 0.9s linear;
}

/* Code — tap to copy */
.code-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    margin: 0;
    padding: 0.95rem 1rem 0.8rem;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #0f2027;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s, filter 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.code-btn:hover {
    filter: brightness(1.02);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.code-btn:active {
    transform: scale(0.98);
}

.code-btn.is-copied {
    outline: 2px solid var(--totp-accent);
    outline-offset: 2px;
}

.code-digits {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: clamp(2.1rem, 9vw, 2.85rem);
    font-weight: 700;
    letter-spacing: 0.28em;
    padding-left: 0.28em;
    line-height: 1.1;
}

.code-hint {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(15, 32, 39, 0.5);
}

.code-btn.is-copied .code-hint {
    color: #0f766e;
}

.source {
    margin: 0.9rem 0 0;
    font-size: 0.84rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.source--secret {
    color: #5eead4;
}

/* Form */
.form {
    margin-top: 1.25rem;
    text-align: left;
}

.field {
    display: block;
    margin-bottom: 0.8rem;
}

.field span {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: rgba(255, 255, 255, 0.85);
}

.field span em {
    font-style: normal;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.62);
}

.field input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.95);
    color: #111;
    font-size: 0.95rem;
}

.field--primary input {
    border-color: rgba(94, 234, 212, 0.55);
    box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.15);
}

.warn {
    margin: -0.3rem 0 0.65rem;
    font-size: 0.78rem;
    color: #fbbf24;
}

.btn {
    width: 100%;
    margin-top: 0.1rem;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 10px;
    background: var(--totp-gradient-btn);
    color: #0a1620;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
}

.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(0.99); }

/* Details as a real control */
.more {
    margin-top: 1rem;
    text-align: left;
}

.more > summary {
    list-style: none;
}

.more > summary::-webkit-details-marker {
    display: none;
}

.details-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, border-color 0.15s;
}

.details-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.5);
}

.more[open] > .details-btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.55);
}

.more-body {
    margin-top: 0.65rem;
    padding: 0.9rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
}

.detail-block {
    margin: 0 0 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.detail-title {
    margin: 0 0 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
}

.detail-lead {
    margin: 0 0 0.75rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.8);
}

.detail-lead code,
.detail-block code {
    font-size: 0.78rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.detail-sub {
    margin: 0.55rem 0 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
}

.detail-block > p {
    margin: 0 0 0.45rem;
    line-height: 1.45;
}

.mono {
    font-family: ui-monospace, monospace;
    font-size: 0.72rem;
    word-break: break-all;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.88);
    margin: 0 !important;
}

.api-section .api-item {
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.7rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.api-section .api-item:last-child {
    margin-bottom: 0;
}

.api-label {
    margin: 0 0 0.2rem !important;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}

.api-desc {
    margin: 0 0 0.45rem !important;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.4;
}

.api-example {
    display: block;
    width: 100%;
    margin: 0 0 0.35rem;
    padding: 0.5rem 0.55rem;
    border-radius: 6px;
    border: 1px solid rgba(94, 234, 212, 0.2);
    background: rgba(0, 0, 0, 0.35);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.7rem;
    line-height: 1.4;
    word-break: break-all;
    color: #a7f3d0;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.api-example:hover {
    border-color: rgba(94, 234, 212, 0.55);
    background: rgba(0, 0, 0, 0.45);
}

.api-example:active {
    transform: scale(0.99);
}

.api-example.is-copied {
    border-color: var(--totp-accent);
    color: #ecfdf5;
}

.api-example:last-child {
    margin-bottom: 0;
}

.copy-link-btn {
    margin-top: 0.35rem;
}

.copy-link-btn.is-copied {
    border-color: var(--totp-accent);
    background: rgba(94, 234, 212, 0.18);
}

.copy-link-status {
    margin: 0.45rem 0 0;
    font-size: 0.72rem;
    word-break: break-all;
    color: rgba(255, 255, 255, 0.7);
    font-family: ui-monospace, monospace;
}

/* Footer */
.app-footer {
    padding: 1rem 1.25rem;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.22);
}

.app-footer p { margin: 0; }
.app-footer a { font-weight: 600; }
