/* ============================================================
   Reading Trolls — Auth CSS
   Login, Register, Profile pages
   Използва rt-tokens CSS променливите за консистентност
   ============================================================ */

.rt-auth-wall {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 20px;
    min-height: 400px;
}

.rt-auth-box {
    background: var(--rt-card-bg);
    border-radius: var(--rt-r3);
    box-shadow: var(--rt-shadow-lg);
    padding: 48px 40px 36px;
    width: 100%;
    max-width: 460px;
    text-align: center;
    border: 1px solid var(--rt-border);
}

.rt-auth-icon     { font-size: 52px; margin-bottom: 12px; }
.rt-auth-title    { font-size: 24px; font-weight: 700; margin: 0 0 8px; color: var(--rt-text); font-family: var(--rt-font-display); }
.rt-auth-subtitle { color: var(--rt-text-muted); font-size: 15px; margin: 0 0 28px; }
.rt-auth-form     { text-align: left; }
.rt-auth-field    { margin-bottom: 18px; }

.rt-auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--rt-text-muted);
    margin-bottom: 6px;
}

.rt-auth-field input[type="text"],
.rt-auth-field input[type="email"],
.rt-auth-field input[type="password"] {
    width: 100% !important;
    padding: 11px 14px !important;
    font-size: 15px !important;
    font-family: var(--rt-font-body) !important;
    border: 2px solid var(--rt-border) !important;
    border-radius: var(--rt-r2) !important;
    box-sizing: border-box !important;
    transition: border-color .2s, box-shadow .2s;
    outline: none !important;
    color: var(--rt-text) !important;
    background: var(--rt-card-bg) !important;
    display: block !important;
    margin: 0 0 0 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.rt-auth-field input:focus {
    border-color: var(--rt-primary) !important;
    box-shadow: 0 0 0 3px var(--rt-primary-soft) !important;
}

.rt-auth-field .rt-field-hint {
    font-size: 12px;
    color: var(--rt-text-light);
    margin-top: 4px;
    display: block;
}

.rt-auth-btn {
    width: 100%;
    padding: 13px;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--rt-font-body);
    background: var(--rt-primary);
    color: var(--rt-primary-fg);
    border: 1px solid var(--rt-primary);
    border-radius: var(--rt-r2);
    cursor: pointer;
    margin-top: 8px;
    transition: background .2s, box-shadow .2s;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
}
.rt-auth-btn:hover    { background: var(--rt-primary-hover); border-color: var(--rt-primary-hover); box-shadow: var(--rt-shadow-hover); }
.rt-auth-btn:active   { background: var(--rt-primary-active); border-color: var(--rt-primary-active); }
.rt-auth-btn:disabled { opacity: .6; cursor: not-allowed; }

.rt-auth-msg {
    padding: 12px 16px;
    border-radius: var(--rt-r2);
    font-size: 14px;
    margin-bottom: 16px;
    text-align: left;
}
.rt-auth-msg.success { background: var(--rt-success-soft); color: var(--rt-success); border: 1px solid var(--rt-success); }
.rt-auth-msg.error   { background: var(--rt-danger-soft);  color: var(--rt-danger);  border: 1px solid var(--rt-danger); }
.rt-auth-msg.info    { background: var(--rt-primary-soft); color: var(--rt-primary); border: 1px solid var(--rt-primary); }

.rt-auth-links   { margin-top: 16px; font-size: 14px; color: var(--rt-text-muted); }
.rt-auth-links p { margin: 6px 0; }
.rt-auth-links a { color: var(--rt-primary); font-weight: 600; text-decoration: none; }
.rt-auth-links a:hover { text-decoration: underline; }

.rt-auth-register-btn {
    display: block;
    padding: 11px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--rt-font-body);
    background: var(--rt-primary-soft);
    color: var(--rt-primary);
    border: 2px solid var(--rt-primary);
    border-radius: var(--rt-r2);
    text-decoration: none;
    transition: all .2s;
}
.rt-auth-register-btn:hover { background: var(--rt-primary); color: var(--rt-primary-fg); }
.rt-auth-links-register { margin-top: 16px; }

/* ============================================================
   Social login (Nextend Google) + divider
   ============================================================ */

.rt-auth-social-login {
    margin: 0 0 18px;
    text-align: center;
}

.rt-auth-social-login .nsl-container,
.rt-auth-social-login .nsl-container-buttons {
    width: 100%;
}

.rt-auth-social-login .nsl-button {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.rt-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--rt-text-muted);
    font-size: 13px;
    line-height: 1.4;
}

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

.rt-auth-divider span {
    white-space: nowrap;
}

/* WordPress loginform overrides */
.rt-auth-box #loginform { text-align: left; }
.rt-auth-box #loginform p { margin-bottom: 16px; }
.rt-auth-box #loginform label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--rt-text-muted); margin-bottom: 6px;
}
.rt-auth-box #loginform input[type="text"],
.rt-auth-box #loginform input[type="password"] {
    width: 100% !important; padding: 11px 14px !important; font-size: 15px !important;
    font-family: var(--rt-font-body) !important;
    border: 2px solid var(--rt-border) !important; border-radius: var(--rt-r2) !important;
    box-sizing: border-box !important; transition: border-color .2s;
    outline: none !important; color: var(--rt-text) !important;
    background: var(--rt-card-bg) !important; display: block !important;
    margin: 0 !important; box-shadow: none !important;
    -webkit-appearance: none !important; appearance: none !important;
}
.rt-auth-box #loginform input[type="text"]:focus,
.rt-auth-box #loginform input[type="password"]:focus {
    border-color: var(--rt-primary) !important;
    box-shadow: 0 0 0 3px var(--rt-primary-soft) !important;
}
.rt-auth-box #loginform .login-remember {
    display: flex; align-items: center;
    gap: 8px; font-size: 14px; color: var(--rt-text-muted);
}
.rt-auth-box #loginform input[type="submit"] {
    width: 100%; padding: 13px; font-size: 16px; font-weight: 600;
    font-family: var(--rt-font-body);
    background: var(--rt-primary); color: var(--rt-primary-fg);
    border: 1px solid var(--rt-primary); border-radius: var(--rt-r2);
    cursor: pointer; margin-top: 8px; transition: background .2s;
}
.rt-auth-box #loginform input[type="submit"]:hover {
    background: var(--rt-primary-hover);
    border-color: var(--rt-primary-hover);
}

.rt-auth-section-title {
    font-size: 16px; font-weight: 700; color: var(--rt-text);
    font-family: var(--rt-font-display);
    border-bottom: 2px solid var(--rt-border); padding-bottom: 8px;
    margin: 28px 0 18px; text-align: left;
}

.rt-auth-danger-zone {
    border: 2px solid var(--rt-danger-soft); border-radius: var(--rt-r2);
    padding: 16px; margin-top: 24px; text-align: left;
    background: var(--rt-danger-soft);
}
.rt-auth-danger-zone p { font-size: 13px; color: var(--rt-danger); margin: 0 0 12px; }

.rt-auth-export-zone {
    border: 1px solid var(--rt-border); border-radius: var(--rt-r2);
    padding: 16px; margin-top: 24px; text-align: left;
    background: var(--rt-surface2);
}

/* Видимост на борда */
.rt-visibility-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 4px;
}

.rt-visibility-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--rt-border);
    border-radius: var(--rt-r2);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: var(--rt-card-bg);
}
.rt-visibility-option:has(input:checked) {
    border-color: var(--rt-primary);
    background: var(--rt-primary-soft);
}
.rt-visibility-option input[type="radio"] {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--rt-primary);
}
.rt-visibility-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}
.rt-visibility-info strong {
    font-size: 14px;
    color: var(--rt-text);
    font-weight: 600;
}
.rt-visibility-info span {
    font-size: 12px;
    color: var(--rt-text-muted);
    line-height: 1.4;
}

@media (max-width: 480px) {
    .rt-auth-box { padding: 36px 20px 28px; }
}

/* ============================================================
   Delete account — danger button + checkbox confirm
   ============================================================ */

.rt-auth-btn-danger {
    background: var(--rt-danger) !important;
    border-color: var(--rt-danger) !important;
    color: #fff !important;
}

.rt-auth-btn-danger:hover,
.rt-auth-btn-danger:focus {
    background: #8f2f24 !important;
    border-color: #8f2f24 !important;
    color: #fff !important;
}

.rt-auth-delete-confirm {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 12px 0 16px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--rt-text);
    text-align: left;
    cursor: pointer;
}

.rt-auth-delete-confirm input {
    margin-top: 3px;
    accent-color: var(--rt-danger);
    flex-shrink: 0;
}

.rt-auth-field input[type="file"] {
    width: 100%;
    font-size: 14px;
    font-family: var(--rt-font-body);
}

.rt-profile-avatar-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.rt-profile-avatar-preview {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    position: relative;
    border-radius: 999px;
    overflow: hidden;
}

.rt-profile-avatar-field {
    flex: 1;
    min-width: 0;
}

.rt-profile-avatar-remove {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--rt-text-muted);
    cursor: pointer;
}

.rt-profile-avatar-status {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--rt-text-muted);
}

.rt-profile-avatar-img,
.rt-user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 999px;
    display: block;
}

/* ============================================================
   Temporary hide — export and visibility секция (pre-production)
   ============================================================ */

.rt-auth-box .rt-auth-export-zone {
    display: none !important;
}

.rt-auth-box > p.rt-auth-section-title:has(+ form .rt-visibility-options),
.rt-auth-box > p.rt-auth-section-title:has(+ .rt-auth-msg + form .rt-visibility-options),
.rt-auth-box > p.rt-auth-section-title:has(+ .rt-auth-msg + .rt-auth-msg + form .rt-visibility-options),
.rt-auth-box > form.rt-auth-form:has(.rt-visibility-options),
.rt-auth-box .rt-auth-export-zone {
    display: none !important;
}
