/* ============================================================
   IAGENTEsmtp Transacional - Standalone CSS
   Replaces Materialize for transacional pages
   ============================================================ */

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

html { line-height: 1.5; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #f9fafb;
    color: #111827;
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: #2e7d32; text-decoration: none; }
a:hover { color: #43a047; }

img { max-width: 100%; height: auto; }

/* ============================================================
   Layout: Split screen
   ============================================================ */
.auth-layout {
    display: flex;
    min-height: 100vh;
}

.auth-sidebar {
    display: none;
    width: 50%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #2e7d32, #43a047);
}

.auth-sidebar-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 3rem;
    color: #fff;
}

.auth-sidebar-inner {
    max-width: 28rem;
    text-align: center;
}

.auth-sidebar h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
}

.auth-sidebar h1 span {
    font-weight: 400;
    opacity: 0.8;
}

.auth-sidebar-desc {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-feature-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255,255,255,0.2);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-feature-icon svg,
.auth-feature-icon i { width: 1.25rem; height: 1.25rem; }

.auth-feature-title { font-weight: 600; font-size: 1rem; }
.auth-feature-subtitle { font-size: 0.875rem; opacity: 0.8; }

/* Decorative circles */
.auth-circle-1 {
    position: absolute;
    bottom: -8rem;
    left: -8rem;
    width: 16rem;
    height: 16rem;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.auth-circle-2 {
    position: absolute;
    top: -4rem;
    right: -4rem;
    width: 12rem;
    height: 12rem;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

/* Form area */
.auth-main {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    background-color: #f9fafb;
    min-height: 100vh;
}

.auth-main-inner {
    width: 100%;
    max-width: 28rem;
}

/* Logo */
.auth-logo {
    margin-bottom: 2rem;
    text-align: center;
}

.auth-logo a {
    display: inline-block;
    text-decoration: none;
}

.auth-logo-text {
    font-size: 1.875rem;
    font-weight: 700;
    color: #2e7d32;
}

.auth-logo-text span {
    font-weight: 400;
    color: #6b7280;
}

/* Card */
.auth-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    padding: 2rem;
    border: 1px solid #f3f4f6;
}

/* Footer */
.auth-footer {
    margin-top: 2rem;
    text-align: center;
}

.auth-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.auth-footer-links a { color: #9ca3af; }
.auth-footer-links a:hover { color: #2e7d32; }
.auth-footer-links .dot { color: #d1d5db; }

.auth-footer-copy {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* ============================================================
   Form Elements
   ============================================================ */
.form-group { margin-bottom: 1rem; }
.form-group-lg { margin-bottom: 1.5rem; }

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.form-input-wrapper { position: relative; }

.form-input-icon {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    padding-left: 0.75rem;
    display: flex;
    align-items: center;
    pointer-events: none;
    color: #9ca3af;
}

.form-input-icon svg,
.form-input-icon i { width: 1.25rem; height: 1.25rem; }

.form-input {
    display: block;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-family: 'Inter', system-ui, sans-serif;
    color: #111827;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

.form-input::placeholder { color: #9ca3af; }

.form-input.has-icon { padding-left: 2.5rem; }
.form-input.has-icon-right { padding-right: 2.5rem; }

.form-input-code {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.5em;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.form-helper {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.form-error {
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Password toggle */
.password-toggle {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    padding-right: 0.75rem;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
}

.password-toggle:hover { color: #6b7280; }
.password-toggle svg,
.password-toggle i { width: 1.25rem; height: 1.25rem; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'Inter', system-ui, sans-serif;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.5;
}

.btn svg,
.btn i { width: 1.25rem; height: 1.25rem; }

.btn-primary {
    background: linear-gradient(to right, #2e7d32, #43a047);
    color: #fff;
    width: 100%;
    box-shadow: 0 4px 6px -1px rgba(46, 125, 50, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(to right, #256d29, #3a9140);
    color: #fff;
    box-shadow: 0 10px 15px -3px rgba(46, 125, 50, 0.4);
}

.btn-warning {
    background-color: #eab308;
    color: #fff;
    width: 100%;
}

.btn-warning:hover { background-color: #ca8a04; color: #fff; }

.btn-disabled,
.btn[disabled] {
    opacity: 0.5;
    pointer-events: none;
}

/* ============================================================
   2FA Method Cards
   ============================================================ */
.method-card {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.method-card:hover {
    border-color: #2e7d32;
    background-color: rgba(46, 125, 50, 0.02);
}

.method-card-selected,
.method-card-selected:hover {
    border-color: #2e7d32;
    background-color: rgba(46, 125, 50, 0.04);
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

.method-card-selected .method-card-icon {
    background: rgba(46, 125, 50, 0.1);
}

.method-card-selected .method-card-icon svg,
.method-card-selected .method-card-icon i {
    color: #2e7d32;
}

.method-card-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.method-card-icon {
    width: 3rem;
    height: 3rem;
    background: #f3f4f6;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.method-card:hover .method-card-icon {
    background: rgba(46, 125, 50, 0.1);
}

.method-card-icon svg,
.method-card-icon i { width: 1.5rem; height: 1.5rem; color: #6b7280; }
.method-card:hover .method-card-icon svg,
.method-card:hover .method-card-icon i { color: #2e7d32; }

.method-card-title { font-weight: 600; color: #111827; }
.method-card-subtitle { font-size: 0.875rem; color: #6b7280; }

.method-card-arrow svg,
.method-card-arrow i { width: 1.25rem; height: 1.25rem; color: #9ca3af; }
.method-card:hover .method-card-arrow svg,
.method-card:hover .method-card-arrow i { color: #2e7d32; }

/* ============================================================
   Status Icon (success, warning, info)
   ============================================================ */
.status-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.status-icon svg,
.status-icon i { width: 2rem; height: 2rem; }

.status-icon-success { background: rgba(46, 125, 50, 0.1); }
.status-icon-success svg,
.status-icon-success i { color: #2e7d32; }

.status-icon-warning { background: rgba(234, 179, 8, 0.1); }
.status-icon-warning svg,
.status-icon-warning i { color: #eab308; }

/* ============================================================
   Typography
   ============================================================ */
.text-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.text-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: #6b7280; }
.text-green { color: #2e7d32; }
.text-strong { font-weight: 600; }

.link-back {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #2e7d32;
}

.link-back:hover { color: #43a047; }
.link-back svg,
.link-back i { width: 1rem; height: 1rem; }

.link-secondary {
    color: #6b7280;
    font-size: 0.875rem;
}

.link-secondary:hover { color: #374151; }

/* ============================================================
   Utilities
   ============================================================ */
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* ============================================================
   Loading spinner
   ============================================================ */
.spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(46, 125, 50, 0.2);
    border-left-color: #2e7d32;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Custom loading overlay */
.smtp-overlay {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smtp-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.smtp-overlay-visible .smtp-overlay-backdrop {
    opacity: 1;
}

.smtp-overlay-card {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 14rem;
    max-width: 20rem;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.smtp-overlay-visible .smtp-overlay-card {
    opacity: 1;
    transform: scale(1);
}

.smtp-overlay-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(46, 125, 50, 0.15);
    border-left-color: #2e7d32;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1.25rem;
}

.smtp-overlay-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #374151;
    text-align: center;
    font-family: "Inter", system-ui, sans-serif;
    line-height: 1.5;
    margin: 0;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 1024px) {
    .auth-sidebar { display: flex; }
    .auth-main { width: 50%; padding: 3rem; }
    .auth-logo { text-align: left; }
}

@media (min-width: 640px) {
    .auth-main { padding: 3rem; }
}
