/**
 * Portal 3 - Organization Registration Portal
 * Modern, Professional Styling
 */

/* ========================================
   GLOBAL STYLES
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #002978 0%, #001a4d 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
    color: #333;
}

/* ========================================
   CONTAINER & LOGIN BOX
======================================== */
.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.login-box {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

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

/* ========================================
   HEADER
======================================== */
.header {
    background: linear-gradient(135deg, #002978 0%, #001a4d 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.logo {
    margin-bottom: 15px;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 5px;
    font-weight: 600;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 300;
}

/* ========================================
   FORM CONTAINER
======================================== */
.form-container {
    padding: 40px 30px;
}

.form-container h2 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #002978;
}

.info-text {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

/* ========================================
   FORM ELEMENTS
======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group input[type="email"],
.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ccdb2c;
    box-shadow: 0 0 0 3px rgba(204, 219, 44, 0.15);
}

/* ========================================
   CODE INPUTS (4-digit)
======================================== */
.code-inputs {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.code-input {
    width: 60px;
    height: 70px;
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.code-input:focus {
    outline: none;
    border-color: #ccdb2c;
    box-shadow: 0 0 0 3px rgba(204, 219, 44, 0.15);
    transform: scale(1.05);
}

/* ========================================
   BUTTONS
======================================== */
.btn {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #ccdb2c 0%, #a8b824 100%);
    color: #002978;
    width: 100%;
    font-weight: 700;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(204, 219, 44, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-link {
    background: none;
    color: #ccdb2c;
    padding: 8px 15px;
    font-size: 14px;
}

.btn-link:hover {
    text-decoration: underline;
    color: #a8b824;
}

.btn-lg {
    padding: 16px 40px;
    font-size: 18px;
}

/* ========================================
   LOADER
======================================== */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 41, 120, 0.3);
    border-top-color: #002978;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========================================
   ALERTS
======================================== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
}

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

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* ========================================
   HELP & RESEND SECTIONS
======================================== */
.help-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.help-section h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #002978;
}

.help-section ul {
    list-style: none;
    padding-left: 0;
}

.help-section li {
    padding: 5px 0;
    font-size: 14px;
    color: #666;
}

.help-section li:before {
    content: "→ ";
    color: #ccdb2c;
    font-weight: bold;
}

.help-section a {
    color: #002978;
    text-decoration: none;
}

.help-section a:hover {
    text-decoration: underline;
    color: #ccdb2c;
}

.resend-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.resend-section p {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.back-link a:hover {
    color: #ccdb2c;
}

/* ========================================
   FOOTER
======================================== */
.footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.footer p {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* ========================================
   DASHBOARD LAYOUT (for register.php)
======================================== */
body:has(.dashboard) {
    background: #f5f5f5;
    padding: 0;
}

.dashboard {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #002978;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    text-align: right;
    line-height: 1.4;
}

.user-info strong {
    color: #002978;
}

.user-info small {
    color: #666;
    font-size: 12px;
}

.content {
    flex: 1;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 30px;
    width: 100%;
}

.page-header {
    margin-bottom: 40px;
}

.page-header h1 {
    color: #002978;
    margin-bottom: 10px;
}

.page-header p {
    color: #666;
    font-size: 16px;
}

/* ========================================
   REGISTRATION FORM
======================================== */
.registration-form {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    color: #002978;
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group.full-width {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }
    
    .login-box {
        border-radius: 0;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .form-container {
        padding: 30px 20px;
    }
    
    .code-inputs {
        gap: 10px;
    }
    
    .code-input {
        width: 50px;
        height: 60px;
        font-size: 28px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .registration-form {
        padding: 25px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .nav-user {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-info {
        text-align: center;
    }
}

/* ========================================
   UTILITY CLASSES
======================================== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* ========================================
   AUTOCOMPLETE DROPDOWN
======================================== */
.autocomplete-dropdown {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    width: calc(100% - 2px);
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: -1px;
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #f8fce5;
    color: #002978;
    border-left: 3px solid #ccdb2c;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

/* Position autocomplete relative to form group */
.form-group {
    position: relative;
}

