/* ==========================================================================
   Nextcloud Login — внешний стиль референса
   ========================================================================== */

/* Tokens
   ------------------------------------------------------------------------- */
:root {
    --bg: #0d0f12;
    --surface: #14181d;
    --surface-2: #1a1f25;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.12);
    --text: #e7eaee;
    --muted: #9ca4ae;
    --faint: #69717b;
    --accent: #67b8ff;
    --accent-strong: #4aa3f5;
    --accent-soft: rgba(103, 184, 255, 0.12);
    --alert: #ff8a7a;
    --alert-soft: rgba(255, 138, 122, 0.10);
    --alert-line: rgba(255, 138, 122, 0.22);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    --shadow-modal: 0 32px 80px rgba(0, 0, 0, 0.6);
    --radius: 16px;
    --radius-sm: 10px;
    --font: 'Satoshi', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset
   ------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base
   ------------------------------------------------------------------------- */
body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(circle at 12% 18%, rgba(103, 184, 255, 0.08), transparent 24%),
        radial-gradient(circle at 88% 14%, rgba(103, 184, 255, 0.06), transparent 24%),
        linear-gradient(180deg, #0a0c0f 0%, #0f1216 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.no-scroll {
    overflow: hidden;
}

/* Shell — карточка входа с появлением
   ------------------------------------------------------------------------- */
.shell {
    width: min(100%, 420px);
    padding: clamp(32px, 5vw, 44px);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
        var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);

    opacity: 0;
    transform: translateY(28px);
    animation: slideUp 1600ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* Brand
   ------------------------------------------------------------------------- */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.brand svg {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.brand-name {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Header
   ------------------------------------------------------------------------- */
.header {
    margin-bottom: 24px;
}

h1 {
    font-size: clamp(1.8rem, 1.5rem + 1vw, 2.4rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 700;
    margin-bottom: 10px;
}

.lead {
    font-size: 0.97rem;
    line-height: 1.65;
    color: var(--muted);
}

/* Alert
   ------------------------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
    background: var(--alert-soft);
    border: 1px solid var(--alert-line);
    border-radius: var(--radius-sm);
    color: var(--alert);
    font-size: 0.9rem;
    line-height: 1.5;
}

.alert[hidden] {
    display: none;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-text {
    color: var(--text);
}

.alert.shake {
    animation: shake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* Form
   ------------------------------------------------------------------------- */
.form {
    display: grid;
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field label {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.field input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 0.97rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 180ms ease, background-color 180ms ease,
                box-shadow 180ms ease;
}

.field input:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.03);
}

.field input:focus {
    border-color: var(--accent);
    background: rgba(103, 184, 255, 0.04);
    box-shadow: 0 0 0 3px rgba(103, 184, 255, 0.14);
}

.field input.has-error {
    border-color: var(--alert);
    background: rgba(255, 138, 122, 0.04);
    box-shadow: 0 0 0 3px rgba(255, 138, 122, 0.14);
}

/* Checkbox
   ------------------------------------------------------------------------- */
.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    margin-top: 2px;
}

.checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Buttons
   ------------------------------------------------------------------------- */
.btn-primary,
.btn-ghost {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 18px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease,
                color 180ms ease, transform 120ms ease;
}

.btn-primary {
    width: 100%;
    margin-top: 6px;
    color: #0a0c0f;
    background: var(--accent);
    border: 1px solid var(--accent);
}

.btn-primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary:focus-visible,
.btn-ghost:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-primary:disabled {
    cursor: progress;
    opacity: 0.85;
}

.btn-ghost {
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line-strong);
}

.btn-ghost:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.18);
}

/* Спиннер в кнопке */
.btn-spinner {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(10, 12, 15, 0.25);
    border-top-color: #0a0c0f;
    border-radius: 50%;
    opacity: 0;
    animation: spin 700ms linear infinite;
    pointer-events: none;
}

.btn-ghost .btn-spinner {
    border-color: rgba(231, 234, 238, 0.25);
    border-top-color: var(--text);
}

.btn-primary.is-loading .btn-label,
.btn-ghost.is-loading .btn-label {
    opacity: 0;
}

.btn-primary.is-loading .btn-spinner,
.btn-ghost.is-loading .btn-spinner {
    opacity: 1;
}

/* Footer links
   ------------------------------------------------------------------------- */
.foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.foot a {
    font-size: 0.9rem;
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
    transition: color 180ms ease;
}

.foot a:hover {
    color: var(--accent-strong);
    text-decoration: underline;
}

/* ==========================================================================
   Модальные окна
   ========================================================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 7, 10, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 220ms ease;
}

.modal-card {
    position: relative;
    width: min(100%, 440px);
    padding: clamp(28px, 4vw, 36px);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
        var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-modal);
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    transition: opacity 240ms ease, transform 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.modal.is-open .modal-backdrop {
    opacity: 1;
}

.modal.is-open .modal-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    transition: color 180ms ease, background-color 180ms ease,
                border-color 180ms ease;
}

.modal-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
}

.modal-close svg {
    width: 16px;
    height: 16px;
}

.modal-header {
    margin-bottom: 22px;
    padding-right: 28px;
}

.modal-header h2 {
    font-size: 1.4rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-header p {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--muted);
}

.modal-form {
    display: grid;
    gap: 16px;
}

.modal-feedback {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    line-height: 1.5;
}

.modal-feedback[hidden] {
    display: none;
}

.modal-feedback[data-type="error"] {
    background: var(--alert-soft);
    border: 1px solid var(--alert-line);
    color: var(--alert);
}

.modal-feedback[data-type="success"] {
    background: var(--accent-soft);
    border: 1px solid rgba(103, 184, 255, 0.22);
    color: var(--accent);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.modal-actions .btn-ghost {
    flex: 0 0 auto;
}

.modal-actions .btn-primary {
    flex: 1 1 auto;
    margin-top: 0;
}

/* Animations
   ------------------------------------------------------------------------- */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .shell,
    .alert.shake,
    .modal-card,
    .modal-backdrop {
        animation: none;
        transition: none;
        opacity: 1;
        transform: none;
    }
    .btn-spinner {
        animation: none;
    }
}

/* Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .modal-actions {
        flex-direction: column-reverse;
    }
    .modal-actions .btn-ghost,
    .modal-actions .btn-primary {
        width: 100%;
    }
}
/* c5caedaec8d62dbd */
.style-a5367ede { display: block; }
