/* =========================================================================
   VARIABLES & RESET
   ========================================================================= */
   :root {
    --primary-color: #EC4899; /* Pink 500 */
    --primary-hover: #DB2777; /* Pink 600 */
    --primary-light: #FCE7F3; /* Pink 100 */
    
    --bg-gradient: linear-gradient(135deg, #FFF1F2 0%, #FDF2F8 100%);
    --surface-color: #FFFFFF;
    
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --error-color: #EF4444;

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    
    --shadow-soft: 0 10px 25px -5px rgba(236, 72, 153, 0.1), 0 8px 10px -6px rgba(236, 72, 153, 0.1);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-float: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    min-height: 100dvh; /* Mobile browser support */
    overflow: hidden; /* Prevent body scroll, everything is in containers */
    display: flex;
    flex-direction: column;
}

/* =========================================================================
   UTILITIES
   ========================================================================= */
.screen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s ease, visibility 0.4s;
    z-index: 1;
}

.screen.active {
    visibility: visible;
    opacity: 1;
    z-index: 10;
}

.hidden {
    display: none !important;
}

/* =========================================================================
   LOGIN SCREEN
   ========================================================================= */
#login-section {
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: var(--surface-color);
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow-soft);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .icon-brand {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 15px;
}

.input-group {
    margin-bottom: 20px;
}

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 20px;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    color: var(--text-main);
    background: #FAFAFA;
    transition: var(--transition);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
    background: var(--surface-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.error-msg {
    color: var(--error-color);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    background: #FEF2F2;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #FECACA;
}

.btn-primary {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    margin-top: 10px;
}

.btn-primary:hover, .btn-primary:active {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =========================================================================
   HOME SCREEN (MODULES)
   ========================================================================= */
#home-section {
    background: #F9FAFB;
    overflow-y: auto;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    height: 60px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    z-index: 20;
    position: sticky;
    top: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-brand i {
    color: var(--primary-color);
    font-size: 24px;
}

.header-brand h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover, .btn-icon:active {
    color: var(--primary-color);
    background: var(--primary-light);
}

.home-content {
    padding: 24px 20px;
    padding-bottom: 40px;
}

.greeting {
    margin-bottom: 32px;
}

.greeting h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.greeting p {
    font-size: 15px;
    color: var(--text-muted);
}

.modules-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.module-card {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.module-card:hover, .module-card:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
    border-color: var(--primary-light);
}

.module-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.module-info {
    flex: 1;
}

.module-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.module-info p {
    font-size: 13px;
    color: var(--text-muted);
}

.module-arrow {
    color: var(--primary-color);
    font-size: 20px;
}

/* =========================================================================
   APP SCREEN (IFRAME VIEWER)
   ========================================================================= */
#app-section {
    background: var(--surface-color);
}

.content-wrapper {
    position: relative;
    flex: 1;
    width: 100%;
    height: calc(100% - 60px);
    background: #F3F4F6;
    overflow: hidden; /* Only iframe should scroll */
}

#content-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#content-iframe.loaded {
    opacity: 1;
}

/* Loader */
.loader-container {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    z-index: 10;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--primary-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loader-container p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* Floating Actions */
.floating-actions {
    position: absolute;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 15;
}

.btn-float {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    box-shadow: var(--shadow-float);
    transition: var(--transition);
}

.btn-float:hover, .btn-float:active {
    color: var(--primary-color);
    border-color: var(--primary-light);
    transform: scale(1.05);
}
