/* =================================================================
   Mawapres - Clean Minimalist Light Theme (DeepSeek Layout 75% Scale)
   ================================================================= */

:root {
    --mp-bg: #ffffff;
    --mp-card-bg: #ffffff;
    --mp-input-bg: #f8fafc;
    --mp-input-border: #e2e8f0;
    --mp-input-border-hover: #cbd5e1;
    --mp-input-focus: #2563eb;
    --mp-text: #0f172a;
    --mp-text-muted: #94a3b8;
    --mp-text-sub: #64748b;
    --mp-blue: #2563eb;
    --mp-blue-hover: #1d4ed8;
    --mp-blue-active: #1e40af;
    --mp-link-alt: #64748b;
    --mp-link-alt-hover: #0f172a;
    --mp-footer: #94a3b8;
    --mp-danger-bg: #fef2f2;
    --mp-danger-border: #fecaca;
    --mp-danger-text: #b91c1c;
    --mp-success-bg: #f0fdf4;
    --mp-success-border: #bbf7d0;
    --mp-success-text: #15803d;
}

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

html, body {
    width: 100%;
    min-height: 100%;
    background-color: var(--mp-bg);
    color: var(--mp-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-color: #ffffff;
}

/* Page Layout: Centered vertically & horizontally */
.mawapres-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 16px 60px 16px;
    width: 100%;
}

/* Compact Container - Scaled to ~75% */
.mawapres-container {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Brand Header */
.brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    text-decoration: none;
    user-select: none;
}

.brand-logo-img {
    height: 46px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
    display: block;
}

.brand-logo-img.brand-logo-emblem {
    height: clamp(56px, 7vw, 68px);
}

.brand-header:hover .brand-logo-img {
    transform: scale(1.02);
}

/* Alert Notification */
.auth-alert-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 9999px;
    font-size: 11.5px;
    line-height: 1.4;
    margin-bottom: 14px;
    animation: fadeIn 0.2s ease-out;
}

.auth-alert-pill.error {
    background-color: var(--mp-danger-bg);
    border: 1px solid var(--mp-danger-border);
    color: var(--mp-danger-text);
}

.auth-alert-pill.success {
    background-color: var(--mp-success-bg);
    border: 1px solid var(--mp-success-border);
    color: var(--mp-success-text);
}

.auth-alert-pill svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.field-group {
    position: relative;
    margin-bottom: 11px;
    width: 100%;
}

.pill-input {
    width: 100%;
    height: 40px;
    background-color: var(--mp-input-bg);
    border: 1px solid var(--mp-input-border);
    border-radius: 9999px;
    padding: 0 16px;
    color: var(--mp-text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.18s, background-color 0.18s, box-shadow 0.18s;
}

.pill-input::placeholder {
    color: var(--mp-text-muted);
    font-size: 12.5px;
    font-weight: 400;
}

.pill-input:hover {
    border-color: var(--mp-input-border-hover);
    background-color: #f1f5f9;
}

.pill-input:focus {
    border-color: var(--mp-input-focus);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.pill-input.has-action {
    padding-right: 40px;
}

/* Password Toggle Icon */
.pwd-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mp-text-muted);
    border-radius: 50%;
    transition: color 0.15s, background-color 0.15s;
}

.pwd-toggle-btn:hover {
    color: #475569;
    background-color: rgba(0, 0, 0, 0.04);
}

.pwd-toggle-btn svg {
    width: 17px;
    height: 17px;
    display: block;
}

/* Disclaimer / Terms text */
.disclaimer-text {
    font-size: 10.5px;
    color: var(--mp-text-sub);
    line-height: 1.45;
    margin: 3px 0 14px 0;
    padding: 0 2px;
}

.disclaimer-text a {
    color: #334155;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
    transition: color 0.15s;
    cursor: pointer;
}

.disclaimer-text a:hover {
    color: var(--mp-blue);
}

/* Action Links (Forgot password? - Sign up) */
.links-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding: 0 2px;
    font-size: 12px;
}

.link-blue {
    color: var(--mp-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s, text-decoration 0.15s;
    cursor: pointer;
}

.link-blue:hover {
    color: var(--mp-blue-hover);
    text-decoration: underline;
}

/* Submit Button */
.btn-login {
    width: 100%;
    height: 40px;
    background-color: var(--mp-blue);
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.18s, transform 0.1s, box-shadow 0.18s;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.btn-login:hover {
    background-color: var(--mp-blue-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-login:active {
    background-color: var(--mp-blue-active);
    transform: scale(0.99);
}

/* Alternative Login */
.alt-login-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    font-size: 11.5px;
}

.alt-link {
    color: var(--mp-link-alt);
    text-decoration: none;
    transition: color 0.15s, text-decoration 0.15s;
    cursor: pointer;
}

.alt-link:hover {
    color: var(--mp-link-alt-hover);
    text-decoration: underline;
}

.alt-sep {
    color: #cbd5e1;
    user-select: none;
    font-size: 10px;
}

/* Footer */
.deepseek-footer {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--mp-footer);
    font-size: 11px;
    user-select: none;
    padding: 0 16px;
    text-align: center;
}

.deepseek-footer a {
    color: var(--mp-footer);
    text-decoration: none;
    transition: color 0.15s;
}

.deepseek-footer a:hover {
    color: var(--mp-text-sub);
    text-decoration: underline;
}

.deepseek-footer .dot {
    opacity: 0.6;
}

/* Modal Popup (for Forgot Password & Terms) */
.ds-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.ds-modal-backdrop.active {
    display: flex;
    animation: fadeIn 0.18s ease-out;
}

.ds-modal-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
    color: #334155;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
    position: relative;
    animation: slideUp 0.2s ease-out;
}

.ds-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
}

.ds-modal-body {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 20px;
}

.ds-modal-body strong {
    color: #0f172a;
}

.ds-modal-close-btn {
    width: 100%;
    height: 38px;
    border-radius: 9999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.ds-modal-close-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* Toast Message */
.ds-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-15px);
    background: #0f172a;
    border: 1px solid #334155;
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 9999px;
    font-size: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s, transform 0.18s;
    z-index: 10000;
}

.ds-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile responsive adjustments */
@media (max-height: 560px) {
    .deepseek-footer {
        position: static;
        margin-top: 30px;
        padding-bottom: 16px;
    }
}

/* =================================================================
   Register Page Specific Styles (Aligned with DeepSeek White Theme)
   ================================================================= */
.mawapres-container.register-container {
    max-width: 440px;
}

.form-intro {
    text-align: center;
    margin-bottom: 18px;
}

.form-intro h2 {
    font-size: 16.5px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 3px;
    letter-spacing: -0.3px;
}

.form-intro p {
    font-size: 11.5px;
    color: var(--mp-text-sub);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.form-label {
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
    padding-left: 2px;
}

.form-label .req {
    color: #ef4444;
    margin-left: 2px;
}

select.pill-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 13px;
    padding-right: 34px;
    cursor: pointer;
}

select.pill-input:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Compact Upload Area */
.upload-box-compact {
    border: 1.5px dashed #cbd5e1;
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: border-color 0.15s, background-color 0.15s;
    user-select: none;
}

.upload-box-compact:hover {
    border-color: var(--mp-blue);
    background-color: #eff6ff;
}

.upload-box-compact.has-file {
    border-color: #10b981;
    border-style: solid;
    background: #f0fdf4;
}

.upload-icon-preview {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #e0e7ff;
    color: var(--mp-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}

.upload-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-text-wrap {
    flex: 1;
    min-width: 0;
}

.upload-file-name {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-file-hint {
    font-size: 10.5px;
    color: #64748b;
}

/* Password Strength & Match Indicator */
.pw-strength-bar-wrap {
    display: flex;
    gap: 4px;
    margin-top: 5px;
}

.pw-bar-item {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: #e2e8f0;
    transition: background-color 0.2s;
}

.pw-bar-item.weak { background: #ef4444; }
.pw-bar-item.medium { background: #f59e0b; }
.pw-bar-item.strong { background: #10b981; }

.pw-desc-text {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 3px;
}

.match-indicator {
    font-size: 10.5px;
    margin-top: 4px;
    display: none;
    align-items: center;
    gap: 4px;
}

.match-indicator.show { display: flex; }
.match-indicator.ok { color: #10b981; }
.match-indicator.no { color: #ef4444; }

/* Switch link to login */
.auth-bottom-switch {
    text-align: center;
    font-size: 12px;
    color: var(--mp-text-sub);
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.auth-bottom-switch a {
    color: var(--mp-blue);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s, text-decoration 0.15s;
}

.auth-bottom-switch a:hover {
    color: var(--mp-blue-hover);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .mawapres-container.register-container {
        max-width: 100%;
    }
    .form-grid-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
