/* =============================================================================
   DesignMitra AI  —  Frontend Styles
   Alpha 3 · Step 1: Auth Pages (Register / Login)
   ============================================================================= */

/* ── Reset & base ──────────────────────────────────────────────────────────── */
.dm-wrap *,
.dm-wrap *::before,
.dm-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --dm-primary:    #f0a500;
    --dm-primary-d:  #d4900a;
    --dm-accent:     #ff6b35;
    --dm-dark:       #1a1a2e;
    --dm-text:       #2d2d3a;
    --dm-text2:      #6b6b80;
    --dm-border:     #e2e2ec;
    --dm-bg:         #f7f7fb;
    --dm-white:      #ffffff;
    --dm-green:      #22c58b;
    --dm-red:        #e53e5a;
    --dm-radius:     14px;
    --dm-radius-sm:  8px;
    --dm-shadow:     0 4px 24px rgba(0,0,0,0.08);
    --dm-shadow-lg:  0 8px 40px rgba(0,0,0,0.13);
}

/* ── Auth wrapper ──────────────────────────────────────────────────────────── */
.dm-auth-page {
    min-height: 100vh;
    background: var(--dm-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.dm-auth-box {
    background: var(--dm-white);
    border-radius: var(--dm-radius);
    box-shadow: var(--dm-shadow-lg);
    width: 100%;
    max-width: 460px;
    overflow: hidden;
}

/* ── Auth header ───────────────────────────────────────────────────────────── */
.dm-auth-header {
    background: linear-gradient(135deg, var(--dm-dark) 0%, #2d1b69 100%);
    padding: 36px 36px 28px;
    text-align: center;
    position: relative;
}

.dm-auth-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0; right: 0;
    height: 20px;
    background: var(--dm-white);
    border-radius: 20px 20px 0 0;
}

.dm-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 8px;
}

.dm-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--dm-primary), var(--dm-accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    font-weight: 700;
}

.dm-logo-text {
    font-size: 22px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.02em;
}

.dm-logo-text span { color: var(--dm-primary); }

.dm-auth-header h1 {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,0.65);
    margin-top: 4px;
}

/* ── Auth body ─────────────────────────────────────────────────────────────── */
.dm-auth-body {
    padding: 28px 36px 36px;
}

/* ── Form elements ─────────────────────────────────────────────────────────── */
.dm-form-group {
    margin-bottom: 18px;
}

.dm-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dm-text);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.dm-form-group label .dm-required {
    color: var(--dm-red);
    margin-left: 2px;
}

.dm-form-group label .dm-optional {
    font-weight: 400;
    color: var(--dm-text2);
    font-size: 11px;
    margin-left: 4px;
}

.dm-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1.5px solid var(--dm-border);
    border-radius: var(--dm-radius-sm);
    font-size: 15px;
    color: var(--dm-text);
    background: var(--dm-white);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
}

.dm-input:focus {
    border-color: var(--dm-primary);
    box-shadow: 0 0 0 3px rgba(240,165,0,0.12);
}

.dm-input.dm-error {
    border-color: var(--dm-red);
    box-shadow: 0 0 0 3px rgba(229,62,90,0.10);
}

.dm-input.dm-success {
    border-color: var(--dm-green);
}

.dm-input-wrap {
    position: relative;
}

.dm-input-wrap .dm-input {
    padding-right: 44px;
}

.dm-input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dm-text2);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    user-select: none;
}

.dm-field-error {
    font-size: 12px;
    color: var(--dm-red);
    margin-top: 5px;
    display: none;
}

.dm-field-error.visible { display: block; }

/* ── Select ────────────────────────────────────────────────────────────────── */
.dm-select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1.5px solid var(--dm-border);
    border-radius: var(--dm-radius-sm);
    font-size: 15px;
    color: var(--dm-text);
    background: var(--dm-white);
    transition: border-color 0.2s;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b6b80' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.dm-select:focus {
    border-color: var(--dm-primary);
    box-shadow: 0 0 0 3px rgba(240,165,0,0.12);
}

/* ── Referral code field ───────────────────────────────────────────────────── */
.dm-referral-field .dm-input {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ── Submit button ─────────────────────────────────────────────────────────── */
.dm-btn {
    display: block;
    width: 100%;
    height: 52px;
    border: none;
    border-radius: var(--dm-radius-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.01em;
    outline: none;
    position: relative;
    overflow: hidden;
}

.dm-btn-primary {
    background: linear-gradient(135deg, var(--dm-primary), var(--dm-accent));
    color: white;
    box-shadow: 0 4px 16px rgba(240,165,0,0.35);
}

.dm-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(240,165,0,0.45);
}

.dm-btn-primary:active { transform: translateY(0); }

.dm-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.dm-btn-loading::after {
    content: '';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: dm-spin 0.7s linear infinite;
}

@keyframes dm-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ── Divider ───────────────────────────────────────────────────────────────── */
.dm-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--dm-text2);
    font-size: 12px;
}

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

/* ── Alert messages ────────────────────────────────────────────────────────── */
.dm-alert {
    padding: 12px 16px;
    border-radius: var(--dm-radius-sm);
    font-size: 13.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.dm-alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.dm-alert-error {
    background: #fff0f3;
    border: 1px solid #ffc0cc;
    color: #c0152a;
}

.dm-alert-success {
    background: #f0fdf8;
    border: 1px solid #a7f0d8;
    color: #0d7a52;
}

.dm-alert-info {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* ── Auth footer links ─────────────────────────────────────────────────────── */
.dm-auth-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
    color: var(--dm-text2);
}

.dm-auth-footer a {
    color: var(--dm-primary-d);
    text-decoration: none;
    font-weight: 600;
}

.dm-auth-footer a:hover { text-decoration: underline; }

.dm-forgot-link {
    text-align: right;
    margin-top: -10px;
    margin-bottom: 18px;
}

.dm-forgot-link a {
    font-size: 12.5px;
    color: var(--dm-text2);
    text-decoration: none;
}

.dm-forgot-link a:hover {
    color: var(--dm-primary-d);
    text-decoration: underline;
}

/* ── Password strength ─────────────────────────────────────────────────────── */
.dm-strength-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--dm-border);
    margin-top: 8px;
    overflow: hidden;
}

.dm-strength-fill {
    height: 100%;
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s, background 0.3s;
}

.dm-strength-fill.weak   { width: 33%; background: var(--dm-red); }
.dm-strength-fill.medium { width: 66%; background: var(--dm-primary); }
.dm-strength-fill.strong { width: 100%; background: var(--dm-green); }

.dm-strength-label {
    font-size: 11px;
    margin-top: 4px;
    color: var(--dm-text2);
}

/* ── Terms checkbox ────────────────────────────────────────────────────────── */
.dm-checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.dm-checkbox-wrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--dm-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.dm-checkbox-wrap label {
    font-size: 13px;
    color: var(--dm-text2);
    cursor: pointer;
    line-height: 1.5;
}

.dm-checkbox-wrap label a {
    color: var(--dm-primary-d);
    text-decoration: none;
    font-weight: 600;
}

/* ── Step indicator (register) ─────────────────────────────────────────────── */
.dm-steps {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 24px;
}

.dm-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dm-border);
    transition: all 0.3s;
}

.dm-step-dot.active {
    background: var(--dm-primary);
    width: 24px;
    border-radius: 4px;
}

.dm-step-dot.done { background: var(--dm-green); }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .dm-auth-body  { padding: 24px 20px 28px; }
    .dm-auth-header { padding: 28px 20px 24px; }
    .dm-logo-text { font-size: 19px; }
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.dm-hidden { display: none !important; }
.dm-text-center { text-align: center; }
.dm-mb-0 { margin-bottom: 0 !important; }
.dm-mt-sm { margin-top: 10px; }
