:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --secondary: #2c3e50;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --border-radius: 12px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Poppins', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
    color: #333;
}

/* ------------------------ INSTALL ------------------------ */
.install-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 900px;
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

.install-header {
    background: linear-gradient(90deg, var(--secondary), #34495e);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.install-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 700;
}

.install-header p {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 300;
}

.platform-badge {
    background: var(--success);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
}

.install-body {
    padding: 40px;
}

@media (max-width: 768px) {
    .install-header {
        padding: 25px 20px;
    }

    .install-header h1 {
        font-size: 24px;
    }

    .install-body {
        padding: 30px 20px;
    }
}

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

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.form-group {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--secondary);
    font-size: 15px;
}

.input-group {
    position: relative;
}

input[type="text"],
input[type="number"],
input[type="password"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
    background-color: #f8fafc;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ------------------------ DATABASE STEP ------------------------ */
.database-install-container {
    max-width: 980px;
}

.database-install-header {
    background:
        radial-gradient(circle at 20% 0%, rgba(5, 217, 232, 0.22), transparent 34%),
        linear-gradient(135deg, #061826 0%, #102a44 54%, #15132c 100%);
    border-bottom: 3px solid #05d9e8;
}

.install-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.install-step {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid #d9e6f2;
    border-radius: 10px;
    background: #f8fafc;
    color: #6c7a89;
}

.install-step span {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dfe8f1;
    color: #2c3e50;
    font-weight: 700;
    flex: 0 0 auto;
}

.install-step strong {
    font-size: 14px;
    color: inherit;
}

.install-step.is-complete {
    border-color: rgba(39, 174, 96, 0.35);
    background: #eefaf3;
    color: #1f8a4c;
}

.install-step.is-complete span {
    background: #27ae60;
    color: #fff;
}

.install-step.is-active {
    border-color: rgba(5, 217, 232, 0.75);
    background: linear-gradient(135deg, #ecfeff, #f8fafc);
    color: #0d6170;
    box-shadow: 0 10px 24px rgba(5, 217, 232, 0.14);
}

.install-step.is-active span {
    background: #05d9e8;
    color: #082033;
}

.database-form {
    padding: 26px;
    border: 1px solid #dbe7f3;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 12px 28px rgba(15, 43, 68, 0.08);
}

.database-form .form-grid {
    margin-bottom: 10px;
}

.database-help {
    border-left-color: #05d9e8;
    background: #f1fbfd;
}

.database-help strong {
    color: #0d6170;
}

@media (max-width: 768px) {
    .install-steps {
        grid-template-columns: 1fr;
    }

    .database-form {
        padding: 18px;
    }
}

.input-hint {
    display: block;
    color: var(--gray);
    font-size: 13px;
    margin-top: 8px;
}

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

.btn:hover {
    background: linear-gradient(90deg, var(--primary-dark), #2471a3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    color: white;
    font-size: 15px;
    display: none;
    animation: slideIn 0.3s ease;
}

.alert-error {
    background: var(--danger);
    border-left: 5px solid #c0392b;
}

.alert-warning {
    background: var(--warning);
    border-left: 5px solid #e67e22;
}

.alert-success {
    background: var(--success);
    border-left: 5px solid #229954;
}

.localhost-warning {
    background: var(--danger);
    color: white;
    padding: 18px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: center;
    font-size: 15px;
    border-left: 5px solid #c0392b;
    animation: pulse 2s infinite;
}

.loading {
    display: none;
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 12px;
}

.help-section {
    background: #f8fafc;
    padding: 25px;
    border-radius: 10px;
    font-size: 14px;
    color: #444;
    line-height: 1.6;
    margin-top: 30px;
    border-left: 4px solid var(--primary);
}

.help-section strong {
    color: var(--secondary);
    display: block;
    margin-bottom: 15px;
    font-size: 16px;
}

.help-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 15px;
}

.help-columns a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.help-columns a:hover {
    text-decoration: underline;
}

.help-columns code {
    background: #eef2f7;
    color: var(--danger);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: monospace;
}

.footer {
    margin-top: 25px;
    padding: 15px;
    background: #e8f4fc;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    color: var(--secondary);
}

/* ------------------------ COMPLETE ------------------------ */
.complete-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 620px;
    overflow: hidden;
    text-align: center;
    animation: fadeIn 0.8s ease-in-out;
}

.complete-header {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 30px 20px;
    position: relative;
    overflow: hidden;
}

.complete-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: float 20s infinite linear;
}

.complete-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.complete-header p {
    font-size: 14px;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.complete-body {
    padding: 25px;
}

.success-icon {
    font-size: 50px;
    color: #27ae60;
    margin-bottom: 8px;
    animation: bounce 1s ease-in-out;
}

.complete-body h2 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 18px;
}

.complete-body > p {
    color: #7f8c8d;
    margin-bottom: 15px;
    font-size: 14px;
}

.btn-success {
    background: #27ae60;
    border-color: #27ae60;
}

.btn-secondary {
    background: linear-gradient(90deg, #2c3e50, #34495e);
}

.btn-secondary:hover {
    background: linear-gradient(90deg, #233140, #2c3e50);
}

.complete-actions .btn {
    max-width: 240px;
}

.activation-info {
    background: #e8f4fd;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    font-size: 13px;
    text-align: left;
    border-left: 4px solid #3498db;
}

.activation-info strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
}

.activation-details {
    display: grid;
    gap: 6px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(52, 152, 219, 0.1);
}

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

.detail-label {
    font-weight: bold;
    color: #34495e;
}

.detail-value {
    color: #2c3e50;
}

.security-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    text-align: left;
    font-size: 13px;
}

.security-notice strong {
    color: #e67e22;
    display: block;
    margin-bottom: 6px;
}

.actions-grid {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 15px 0;
}

.complete-steps {
    margin-bottom: 18px;
}

.admin-credentials {
    background: linear-gradient(180deg, #f8fbff 0%, #eef8fb 100%);
    border: 1px solid rgba(5, 217, 232, 0.45);
    border-left: 5px solid #05d9e8;
    border-radius: 12px;
    padding: 18px;
    margin: 18px 0;
    text-align: left;
    box-shadow: 0 10px 24px rgba(5, 217, 232, 0.1);
}

.admin-credentials strong {
    display: block;
    color: #102a44;
    font-size: 16px;
    margin-bottom: 12px;
}

.credential-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(16, 42, 68, 0.09);
    font-size: 14px;
}

.credential-row:last-of-type {
    border-bottom: none;
}

.credential-row span {
    color: #546879;
    font-weight: 600;
}

.credential-row code,
.credential-row a {
    color: #102a44;
    font-weight: 700;
    text-decoration: none;
    background: #eaf2f8;
    border-radius: 6px;
    padding: 4px 8px;
}

.admin-credentials p {
    color: #6c757d;
    font-size: 13px;
    margin-top: 12px;
}

@media (max-width: 480px) {
    .complete-container {
        margin: 10px;
    }

    .complete-header {
        padding: 25px 15px;
    }

    .complete-body {
        padding: 20px 15px;
    }

    .success-icon {
        font-size: 45px;
    }

    .actions-grid {
        flex-direction: column;
    }

    .credential-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* ------------------------ ERROR PAGE ------------------------ */
.error-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 480px;
    text-align: center;
    overflow: hidden;
    animation: fadeIn 0.8s ease-in-out;
}

.error-header {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 30px 20px;
    position: relative;
}

.error-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: float 18s linear infinite;
}

.error-icon {
    font-size: 70px;
    color: #fff;
    margin-bottom: 8px;
    animation: pulse 1.2s ease-in-out infinite;
}

.error-header h1 {
    font-size: 24px;
    font-weight: bold;
    position: relative;
    z-index: 2;
}

.error-body {
    padding: 30px 25px;
    color: #2c3e50;
}

.error-body p {
    font-size: 15px;
    margin-bottom: 15px;
}

.debug-box {
    background: #f8d7da;
    border-left: 4px solid #c0392b;
    border-radius: 8px;
    padding: 12px;
    text-align: left;
    font-size: 13px;
    color: #721c24;
    margin: 15px 0;
}

.debug-box strong {
    color: #c0392b;
}

.actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.btn-back {
    background: #3498db;
}

.btn-back:hover {
    background: #2980b9;
}

.btn-support {
    background: #27ae60;
}

.btn-support:hover {
    background: #1e8449;
}

@media (max-width: 480px) {
    .error-container {
        max-width: 90%;
        margin: 10px;
    }

    .error-header h1 {
        font-size: 20px;
    }

    .error-icon {
        font-size: 60px;
    }

    .error-body {
        padding: 20px 15px;
    }

    .actions {
        flex-direction: column;
    }
}

/* ------------------------ ANIMATIONS ------------------------ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(-20px, -20px) rotate(360deg);
    }
}

.icon {
    font-size: 20px;
    margin-right: 8px;
}

.actions a {
    text-decoration: none;
    color: inherit;
}

.actions a:hover,
.actions a:focus {
    text-decoration: none;
    color: inherit;
}

a.btn, 
a.btn:link, 
a.btn:visited, 
a.btn:hover, 
a.btn:focus, 
a.btn:active {
    text-decoration: none !important;
    color: #fff !important;
}
