/* ============================================
   EPROM Smart Engine - Brand Theme CSS
   Primary: #00529b | Accent: #8cc63f | Light: #1e83ec
   Font: Open Sans
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    background: #f0f2f5;
    min-height: 100vh;
}

a {
    color: #00529b;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #1e83ec;
}

/* === Layout === */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* === Navbar === */
.navbar {
    background: #fff;
    border-bottom: 3px solid #00529b;
    box-shadow: 0 2px 8px rgba(0, 82, 155, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-img {
    height: 44px;
    width: auto;
    display: block;
}

.logo-sub {
    font-size: 13px;
    font-weight: 600;
    color: #8cc63f;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #00529b;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(0, 82, 155, 0.06);
    color: #1e83ec;
}

.nav-link-logout {
    color: #c0392b;
}

.nav-link-logout:hover {
    background: rgba(192, 57, 43, 0.06);
    color: #e74c3c;
}

/* === Auth Card === */
.auth-container {
    width: 100%;
    max-width: 460px;
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 82, 155, 0.1);
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, #00529b 0%, #1e83ec 100%);
    padding: 32px 36px 28px;
    text-align: center;
}

.auth-header h1 {
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
}

.auth-header p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    font-weight: 300;
}

.auth-body {
    padding: 32px 36px 36px;
}

/* === Form Elements === */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: #333;
    background: #f8f9fb;
    border: 2px solid #e0e4ea;
    border-radius: 8px;
    transition: all 0.2s ease;
    outline: none;
}

.form-control:focus {
    border-color: #00529b;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 82, 155, 0.1);
}

.form-control::placeholder {
    color: #aab;
}

.form-control.is-invalid {
    border-color: #e74c3c;
}

.form-hint {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    line-height: 1;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 82, 155, 0.2);
}

/* Primary: See-through with blue border */
.btn-primary {
    background: transparent;
    color: #00529b;
    border-color: #00529b;
}

.btn-primary:hover {
    background: #8cc63f;
    border-color: #8cc63f;
    color: #fff;
}

/* Solid variant for submit */
.btn-submit {
    width: 100%;
    background: #00529b;
    color: #fff;
    border-color: #00529b;
    padding: 13px 28px;
    font-size: 15px;
}

.btn-submit:hover {
    background: #8cc63f;
    border-color: #8cc63f;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(140, 198, 63, 0.3);
}

/* Secondary / outline */
.btn-secondary {
    background: transparent;
    color: #555;
    border-color: #ccc;
}

.btn-secondary:hover {
    border-color: #00529b;
    color: #00529b;
}

/* Danger */
.btn-danger {
    background: transparent;
    color: #e74c3c;
    border-color: #e74c3c;
}

.btn-danger:hover {
    background: #e74c3c;
    color: #fff;
}

/* Small */
.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

/* === OTP Input === */
.otp-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0;
}

.otp-input {
    width: 60px;
    height: 64px;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #00529b;
    background: #f8f9fb;
    border: 2px solid #e0e4ea;
    border-radius: 10px;
    transition: all 0.2s ease;
    outline: none;
}

.otp-input:focus {
    border-color: #00529b;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 82, 155, 0.1);
}

/* === Alerts === */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #f0faf0;
    color: #2d6a2d;
    border-left-color: #8cc63f;
}

.alert-error {
    background: #fef0f0;
    color: #c0392b;
    border-left-color: #e74c3c;
}

.alert-info {
    background: #f0f4fa;
    color: #00529b;
    border-left-color: #1e83ec;
}

/* === Auth Links === */
.auth-links {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.auth-links a {
    font-size: 13px;
    font-weight: 600;
    color: #00529b;
}

.auth-links a:hover {
    color: #8cc63f;
}

.auth-links p {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}

/* === Password toggle === */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 13px;
    font-weight: 600;
    padding: 4px;
    font-family: 'Open Sans', sans-serif;
}

.password-toggle:hover {
    color: #00529b;
}

/* === Dashboard === */
.dashboard-container {
    width: 100%;
    max-width: 900px;
}

.dashboard-welcome {
    background: linear-gradient(135deg, #00529b 0%, #1e83ec 100%);
    border-radius: 12px;
    padding: 36px 40px;
    color: #fff;
    margin-bottom: 24px;
}

.dashboard-welcome h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.dashboard-welcome p {
    font-size: 14px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.dash-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    border-top: 3px solid #00529b;
}

.dash-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: #00529b;
    margin-bottom: 8px;
}

.dash-card .value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.dash-card .label {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* === Applications Grid === */
.apps-section {
    margin-top: 32px;
}

.apps-title {
    font-size: 18px;
    font-weight: 700;
    color: #00529b;
    margin-bottom: 16px;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.app-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
}

.app-card:hover {
    border-color: #00529b;
    box-shadow: 0 4px 20px rgba(0, 82, 155, 0.12);
    transform: translateY(-2px);
    color: inherit;
}

.app-card-icon {
    flex-shrink: 0;
}

.app-card-body {
    flex: 1;
    min-width: 0;
}

.app-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin: 0 0 4px;
}

.app-card-desc {
    font-size: 12px;
    color: #777;
    margin: 0 0 8px;
    line-height: 1.4;
}

.app-card-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    background: #e8fae8;
    color: #2d6a2d;
}

.app-card-arrow {
    flex-shrink: 0;
    color: #ccc;
    transition: color 0.2s ease, transform 0.2s ease;
}

.app-card:hover .app-card-arrow {
    color: #00529b;
    transform: translateX(4px);
}

@media (max-width: 600px) {
    .apps-grid {
        grid-template-columns: 1fr;
    }
}

/* === Subscription Badge === */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-none {
    background: #f0f0f0;
    color: #888;
}

.badge-standard {
    background: #e8f4fd;
    color: #00529b;
}

.badge-standard_ai {
    background: #f0fae8;
    color: #5a8a24;
}

.badge-featured {
    background: linear-gradient(135deg, #00529b, #1e83ec);
    color: #fff;
}

.badge-active {
    background: #e8fae8;
    color: #2d6a2d;
}

.badge-pending {
    background: #fff8e8;
    color: #c08a00;
}

.badge-suspended {
    background: #fae8e8;
    color: #c0392b;
}

/* === Admin Panel === */
.admin-container {
    width: 100%;
    max-width: 1100px;
    align-self: flex-start;
    padding-top: 20px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.admin-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: #00529b;
}

.admin-stats {
    display: flex;
    gap: 16px;
}

.stat-box {
    background: #fff;
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
    min-width: 100px;
}

.stat-box .stat-num {
    font-size: 24px;
    font-weight: 700;
    color: #00529b;
}

.stat-box .stat-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
}

/* === Table === */
.table-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fb;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e4ea;
}

.data-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: #444;
    border-bottom: 1px solid #f0f0f0;
}

.data-table tr:hover {
    background: #f8f9fb;
}

.data-table .user-email {
    font-weight: 600;
    color: #00529b;
}

/* === Admin Modal === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #00529b, #1e83ec);
    padding: 20px 24px;
    color: #fff;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid #eee;
}

/* === Resend OTP === */
.resend-section {
    text-align: center;
    margin-top: 20px;
}

.resend-section p {
    font-size: 13px;
    color: #888;
}

.resend-btn {
    background: none;
    border: none;
    color: #00529b;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    text-decoration: underline;
}

.resend-btn:hover {
    color: #8cc63f;
}

.resend-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
    text-decoration: none;
}

/* === Footer === */
.app-footer {
    background: #fff;
    border-top: 3px solid #00529b;
    padding: 20px 24px;
    text-align: center;
}

.footer-slogan {
    font-size: 13px;
    font-weight: 600;
    color: #8cc63f;
    margin-bottom: 4px;
}

.footer-copy {
    font-size: 12px;
    color: #999;
}

/* === Responsive === */
@media (max-width: 600px) {
    .auth-body {
        padding: 24px 20px 28px;
    }

    .auth-header {
        padding: 24px 20px;
    }

    .nav-container {
        padding: 0 16px;
    }

    .otp-input {
        width: 52px;
        height: 56px;
        font-size: 24px;
    }

    .dashboard-welcome {
        padding: 24px 20px;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .admin-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .admin-stats {
        flex-wrap: wrap;
    }
}

/* === Utility === */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
