/* ==========================================================================
   shared styles for html in the auth folder (login.css and mobile.css excluded)
   ========================================================================== */

/* Signup/signup_disposable: use same body background as login so the screensaver
   (transparent canvases) shows the same background color instead of theme --bg-primary */
body:has(.auth-container--signup) {
    background-color: #1a1a1a;
}

/* --------------------------------------------------------------------------
   Full-page auth layout (password reset, rate limited, server full)
   -------------------------------------------------------------------------- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

.auth-container--narrow {
    max-width: 500px;
    margin: 50px auto;
    padding: 20px;
    min-height: 0;
}

.auth-container--signup {
    min-height: 80vh;
}

.auth-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Auth cards
   -------------------------------------------------------------------------- */
.auth-card {
    background: var(--card-bg-color, rgba(32, 32, 32, 0.95));
    border: 1px solid var(--border-color, #404040);
    border-radius: 8px;
    padding: 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.auth-card--centered {
    max-width: 480px;
    text-align: center;
}

.auth-card--wide {
    max-width: 600px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* --------------------------------------------------------------------------
   Form card (delete account, wipe files)
   -------------------------------------------------------------------------- */
.auth-form-card,
.form-card {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.auth-form-header,
.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-form-header h1,
.form-header h1 {
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 28px;
}

.auth-form-header p,
.form-header p {
    color: var(--text-color-muted);
    margin: 0;
    font-size: 16px;
}

/* --------------------------------------------------------------------------
   Auth header (inside cards) – default
   -------------------------------------------------------------------------- */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    color: var(--primary-color, #4a9eff);
    margin-bottom: 10px;
    font-size: 32px;
    font-family: var(--font-family-base, inherit);
    font-weight: 600;
    line-height: 1.2;
}

.auth-header p {
    color: var(--text-color-muted, #888);
    margin: 0 0 15px 0;
    line-height: 1.4;
}

/* Centered cards (rate limited, server full): orange accent */
.auth-card--centered .auth-header h2 {
    color: #f0a030;
    margin-bottom: 10px;
    font-size: 28px;
}

.auth-card--centered .auth-header p {
    margin: 0 0 10px 0;
}

/* Signup/signup_disposable header */
.auth-card--wide .auth-header h2 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.auth-card--wide .auth-header p {
    margin: 0;
}

/* --------------------------------------------------------------------------
   Auth form, links, buttons (shared)
   -------------------------------------------------------------------------- */
.auth-form {
    margin-bottom: 20px;
}

.auth-links {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #404040);
}

.auth-links p {
    margin: 10px 0;
    color: var(--text-color-muted, #888);
}

.auth-link,
.auth-link-text {
    color: var(--primary-color, #4a9eff);
    text-decoration: none;
    font-size: 14px;
}

.auth-link:hover,
.auth-link-text:hover {
    text-decoration: underline;
}

.auth-btn {
    display: inline-block;
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 500;
    margin-top: 10px;
    background: var(--primary-color, #4a9eff);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    box-sizing: border-box;
}

.auth-btn:hover {
    background: var(--primary-color-hover, #357abd);
    text-decoration: none;
    color: white;
}

/* --------------------------------------------------------------------------
   Form groups and inputs (auth forms)
   -------------------------------------------------------------------------- */
.auth-form .form-group,
.auth-card .form-group {
    margin-bottom: 20px;
}

.auth-form .form-group label,
.auth-card .form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color, #e0e0e0);
    font-weight: 500;
}

.auth-form .form-group input,
.auth-card .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color, #404040);
    border-radius: 4px;
    background: var(--input-bg-color, #2a2a2a);
    color: var(--text-color, #e0e0e0);
    font-size: 16px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.auth-form .form-group input:focus,
.auth-card .form-group input:focus {
    outline: none;
    border-color: var(--primary-color, #4a9eff);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.form-group label {
    display: block;
    color: var(--text-color);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    background: var(--input-bg-color);
    color: var(--text-color);
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2);
}

.form-errors {
    margin-top: 5px;
}

.error-text {
    color: #dc3545;
    font-size: 14px;
    margin: 2px 0;
}

.help-text {
    color: var(--text-color-muted, #888);
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.auth-card--wide .help-text {
    font-size: 12px;
}

/* --------------------------------------------------------------------------
   Rate limited / server full: icon, message, actions
   -------------------------------------------------------------------------- */
.rate-limited-icon,
.server-full-icon {
    margin-bottom: 20px;
}

.rate-limited-icon span,
.server-full-icon span {
    font-size: 64px;
    display: block;
    animation: auth-pulse 2s infinite;
}

@keyframes auth-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

.rate-limited-message,
.server-full-message {
    margin-bottom: 30px;
}

.rate-limited-info,
.capacity-info {
    color: var(--text-color, #e0e0e0);
    font-size: 18px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(240, 160, 48, 0.1);
    border: 1px solid rgba(240, 160, 48, 0.3);
    border-radius: 6px;
}

.rate-limited-info strong,
.capacity-info strong {
    color: #f0a030;
}

.auth-card--centered .explanation {
    color: var(--text-color-muted, #888);
    font-size: 14px;
    line-height: 1.6;
}

.rate-limited-actions,
.server-full-actions {
    margin-bottom: 20px;
}

.server-full-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #404040);
}

.server-full-footer p {
    color: var(--text-color-muted, #666);
    font-size: 12px;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Delete account: warning, buttons
   -------------------------------------------------------------------------- */
.warning-section {
    margin-bottom: 30px;
}

.warning-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    color: #856404;
}

.warning-box h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #856404;
}

.warning-box p {
    margin: 0 0 10px 0;
}

.warning-box ul {
    margin: 0;
    padding-left: 20px;
}

.warning-box li {
    margin-bottom: 5px;
}

.credits-warning {
    margin-top: 15px;
    padding: 12px 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
    font-weight: 600;
    font-size: 16px;
}

.auth-button-group,
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.auth-form-card .btn,
.form-card .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Modal (delete account, wipe files)
   -------------------------------------------------------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    color: var(--text-color);
    margin: 0 0 10px 0;
    font-size: 22px;
}

.modal-content p {
    color: var(--text-color-muted);
    margin: 0 0 20px 0;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-buttons .btn-inactive {
    background-color: rgb(100, 170, 235);
    color: white;
}

.modal-buttons .btn-inactive:hover {
    background-color: var(--button-primary);
    color: white;
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 12px;
    color: #721c24;
    margin-bottom: 20px;
}

/* --------------------------------------------------------------------------
   Signup / signup_disposable: username copy, notification popup
   -------------------------------------------------------------------------- */
.username-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.username-container input {
    flex: 1;
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 15px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--primary-color-dark, #0056b3);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn.copied {
    background: #28a745;
}

.notification-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    max-width: 300px;
    font-size: 14px;
    font-weight: 500;
}

.notification-popup.show {
    transform: translateX(0);
}

.notification-popup.hide {
    transform: translateX(100%);
}

.copy-this-btn:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* --------------------------------------------------------------------------
   Password change page (profile-style form)
   -------------------------------------------------------------------------- */
.auth-password-change .profile-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.auth-password-change .profile-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-password-change .profile-header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 32px;
}

.auth-password-change .profile-header p {
    color: var(--text-color-muted);
    margin: 0;
}

.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

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

.auth-password-change .profile-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.auth-password-change .profile-section {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section-header {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.section-header h2 {
    color: var(--text-color);
    margin: 0 0 5px 0;
    font-size: 20px;
}

.auth-password-change .profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-password-change .form-group {
    flex: 1;
    margin-bottom: 0;
}

.auth-password-change .form-group label {
    color: var(--text-color);
}

.auth-password-change .form-group input {
    background: var(--input-bg-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

.auth-password-change .help-text {
    font-size: 14px;
    line-height: 1.4;
}

.button-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.auth-password-change .button-group {
    flex: 1;
    margin-bottom: 0;
}

.half-width {
    flex: 1;
}

.auth-password-change .btn {
    width: 200px;
    height: 50px;
    padding: 0;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    box-sizing: border-box;
}

.auth-password-change .btn-primary {
    background-color: #007bff;
    color: white;
}

.auth-password-change .btn-primary:hover {
    background-color: #0056b3;
    text-decoration: none;
    color: white;
}

.auth-password-change .btn-secondary,
.cancel-btn {
    background-color: #6c757d;
    color: white;
}

.auth-password-change .btn-secondary:hover,
.cancel-btn:hover {
    background-color: #545b62;
    text-decoration: none;
    color: white;
}

/* --------------------------------------------------------------------------
   Wipe files page
   -------------------------------------------------------------------------- */
.wipe-files-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 20px;
}

.wipe-files-container .form-card {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wipe-files-container .form-header {
    text-align: center;
    margin-bottom: 30px;
}

.wipe-files-container .form-header h1 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 28px;
}

.wipe-files-container .form-header p {
    color: var(--text-color-muted);
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
}

.wipe-button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.wipe-button-group .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.wipe-button-group .btn-inactive,
.wipe-button-group a.btn-inactive {
    background-color: rgb(100, 170, 235);
    color: white;
}

.wipe-button-group .btn-inactive:hover,
.wipe-button-group a.btn-inactive:hover {
    background-color: var(--button-primary);
    transform: translateY(-1px);
    text-decoration: none;
    color: white;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .auth-container--narrow {
        margin: 20px auto;
        padding: 15px;
    }

    .auth-form-card,
    .form-card {
        padding: 30px 20px;
    }

    .auth-button-group,
    .button-group {
        flex-direction: column;
    }

    .auth-form-card .btn,
    .form-card .btn {
        width: 100%;
    }

    .modal-buttons {
        flex-direction: column-reverse;
    }

    .modal-buttons .btn {
        width: 100%;
    }

    .wipe-files-container {
        margin: 20px auto;
        padding: 15px;
    }

    .wipe-files-container .form-card {
        padding: 30px 20px;
    }

    .button-row {
        flex-direction: column;
    }
}
